当前位置: 首页>>代码示例>>Java>>正文


Java World.getBiomeProvider方法代码示例

本文整理汇总了Java中net.minecraft.world.World.getBiomeProvider方法的典型用法代码示例。如果您正苦于以下问题:Java World.getBiomeProvider方法的具体用法?Java World.getBiomeProvider怎么用?Java World.getBiomeProvider使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.world.World的用法示例。


在下文中一共展示了World.getBiomeProvider方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getStoneTypeAt

import net.minecraft.world.World; //导入方法依赖的package包/类
public static EnumRockClass getStoneTypeAt(World w, BlockPos at)
{
	if (lastRememberedSeed != w.getSeed())
	{
		rand.setSeed(w.getSeed());
		offsetStone = new Vec3i(rand.nextInt(300000) - rand.nextInt(300000), 0, rand.nextInt(300000) - rand.nextInt(300000));
		offsetDirt = new Vec3i(rand.nextInt(300000) - rand.nextInt(300000), 0, rand.nextInt(300000) - rand.nextInt(300000));
	}
	
	BlockPos actual = at.add(offsetStone);
	
	try
	{
		FeatureProvider provider = ((BiomeProviderExP)w.getBiomeProvider()).featureProvider;
		return EnumRockClass.values()[Math.abs(provider.getByte(actual, provider.cacheRocks)) % 16];
	}
	catch (Exception ex)
	{
		ex.printStackTrace();
		return EnumRockClass.ANDESITE;
	}
}
 
开发者ID:V0idWa1k3r,项目名称:ExPetrum,代码行数:23,代码来源:GenerationHelper.java

示例2: getDirtTypeAt

import net.minecraft.world.World; //导入方法依赖的package包/类
public static EnumDirtClass getDirtTypeAt(World w, BlockPos at)
{
	if (lastRememberedSeed != w.getSeed())
	{
		rand.setSeed(w.getSeed());
		offsetStone = new Vec3i(rand.nextInt(300000) - rand.nextInt(300000), 0, rand.nextInt(300000) - rand.nextInt(300000));
		offsetDirt = new Vec3i(rand.nextInt(300000) - rand.nextInt(300000), 0, rand.nextInt(300000) - rand.nextInt(300000));
	}
	
	BlockPos actual = at.add(offsetDirt);
	
	try
	{
		FeatureProvider provider = ((BiomeProviderExP)w.getBiomeProvider()).featureProvider;
		return EnumDirtClass.values()[Math.abs(provider.getByte(actual, provider.cacheSoil)) % 16];
	}
	catch (Exception ex)
	{
		ex.printStackTrace();
		return EnumDirtClass.ACRISOL;
	}
}
 
开发者ID:V0idWa1k3r,项目名称:ExPetrum,代码行数:23,代码来源:GenerationHelper.java

示例3: getATGBiomeProvider

import net.minecraft.world.World; //导入方法依赖的package包/类
public static BiomeProviderATG getATGBiomeProvider(World world) {
    BiomeProvider provider = world.getBiomeProvider();
    if (provider instanceof BiomeProviderATG) {
        return (BiomeProviderATG)provider;
    }

    //todo: if deemed necessary, some form of recursive field search in case the biome provider is wrapped

    return null;
}
 
开发者ID:stuebz88,项目名称:modName,代码行数:11,代码来源:GeneralUtil.java

示例4: Start

import net.minecraft.world.World; //导入方法依赖的package包/类
public Start(World worldIn, Random rand, int x, int z, int size)
{
    super(x, z);
    List<StructureVillagePieces.PieceWeight> list = StructureVillagePieces.getStructureVillageWeightedPieceList(rand, size);
    StructureVillagePieces.Start structurevillagepieces$start = new StructureVillagePieces.Start(worldIn.getBiomeProvider(), 0, rand, (x << 4) + 2, (z << 4) + 2, list, size);
    this.components.add(structurevillagepieces$start);
    structurevillagepieces$start.buildComponent(structurevillagepieces$start, this.components, rand);
    List<StructureComponent> list1 = structurevillagepieces$start.pendingRoads;
    List<StructureComponent> list2 = structurevillagepieces$start.pendingHouses;

    while (!list1.isEmpty() || !list2.isEmpty())
    {
        if (list1.isEmpty())
        {
            int i = rand.nextInt(list2.size());
            StructureComponent structurecomponent = (StructureComponent)list2.remove(i);
            structurecomponent.buildComponent(structurevillagepieces$start, this.components, rand);
        }
        else
        {
            int j = rand.nextInt(list1.size());
            StructureComponent structurecomponent2 = (StructureComponent)list1.remove(j);
            structurecomponent2.buildComponent(structurevillagepieces$start, this.components, rand);
        }
    }

    this.updateBoundingBox();
    int k = 0;

    for (StructureComponent structurecomponent1 : this.components)
    {
        if (!(structurecomponent1 instanceof StructureVillagePieces.Road))
        {
            ++k;
        }
    }

    this.hasMoreThanTwoComponents = k > 2;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:40,代码来源:MapGenVillage.java

示例5: getClosestStrongholdPos

import net.minecraft.world.World; //导入方法依赖的package包/类
public BlockPos getClosestStrongholdPos(World worldIn, BlockPos pos, boolean p_180706_3_)
{
    this.worldObj = worldIn;
    BiomeProvider biomeprovider = worldIn.getBiomeProvider();
    return biomeprovider.func_190944_c() && biomeprovider.func_190943_d() != Biomes.ROOFED_FOREST ? null : func_191069_a(worldIn, this, pos, 80, 20, 10387319, true, 100, p_180706_3_);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:7,代码来源:WoodlandMansion.java


注:本文中的net.minecraft.world.World.getBiomeProvider方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。