本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例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_);
}