本文整理汇总了Java中net.minecraft.world.chunk.ChunkPrimer.findGroundBlockIdx方法的典型用法代码示例。如果您正苦于以下问题:Java ChunkPrimer.findGroundBlockIdx方法的具体用法?Java ChunkPrimer.findGroundBlockIdx怎么用?Java ChunkPrimer.findGroundBlockIdx使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.chunk.ChunkPrimer
的用法示例。
在下文中一共展示了ChunkPrimer.findGroundBlockIdx方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: func_191070_b
import net.minecraft.world.chunk.ChunkPrimer; //导入方法依赖的package包/类
private static int func_191070_b(int p_191070_0_, int p_191070_1_, ChunkProviderEnd p_191070_2_)
{
Random random = new Random((long)(p_191070_0_ + p_191070_1_ * 10387313));
Rotation rotation = Rotation.values()[random.nextInt(Rotation.values().length)];
ChunkPrimer chunkprimer = new ChunkPrimer();
p_191070_2_.setBlocksInChunk(p_191070_0_, p_191070_1_, chunkprimer);
int i = 5;
int j = 5;
if (rotation == Rotation.CLOCKWISE_90)
{
i = -5;
}
else if (rotation == Rotation.CLOCKWISE_180)
{
i = -5;
j = -5;
}
else if (rotation == Rotation.COUNTERCLOCKWISE_90)
{
j = -5;
}
int k = chunkprimer.findGroundBlockIdx(7, 7);
int l = chunkprimer.findGroundBlockIdx(7, 7 + j);
int i1 = chunkprimer.findGroundBlockIdx(7 + i, 7);
int j1 = chunkprimer.findGroundBlockIdx(7 + i, 7 + j);
int k1 = Math.min(Math.min(k, l), Math.min(i1, j1));
return k1;
}
示例2: create
import net.minecraft.world.chunk.ChunkPrimer; //导入方法依赖的package包/类
private void create(World worldIn, ChunkProviderEnd chunkProvider, Random rnd, int chunkX, int chunkZ)
{
Rotation rotation = Rotation.values()[rnd.nextInt(Rotation.values().length)];
ChunkPrimer chunkprimer = new ChunkPrimer();
chunkProvider.setBlocksInChunk(chunkX, chunkZ, chunkprimer);
int i = 5;
int j = 5;
if (rotation == Rotation.CLOCKWISE_90)
{
i = -5;
}
else if (rotation == Rotation.CLOCKWISE_180)
{
i = -5;
j = -5;
}
else if (rotation == Rotation.COUNTERCLOCKWISE_90)
{
j = -5;
}
int k = chunkprimer.findGroundBlockIdx(7, 7);
int l = chunkprimer.findGroundBlockIdx(7, 7 + j);
int i1 = chunkprimer.findGroundBlockIdx(7 + i, 7);
int j1 = chunkprimer.findGroundBlockIdx(7 + i, 7 + j);
int k1 = Math.min(Math.min(k, l), Math.min(i1, j1));
if (k1 < 60)
{
this.isSizeable = false;
}
else
{
BlockPos blockpos = new BlockPos(chunkX * 16 + 8, k1, chunkZ * 16 + 8);
StructureEndCityPieces.beginHouseTower(blockpos, rotation, this.components, rnd);
this.updateBoundingBox();
this.isSizeable = true;
}
}
示例3: func_191092_a
import net.minecraft.world.chunk.ChunkPrimer; //导入方法依赖的package包/类
private void func_191092_a(World p_191092_1_, ChunkProviderOverworld p_191092_2_, Random p_191092_3_, int p_191092_4_, int p_191092_5_)
{
Rotation rotation = Rotation.values()[p_191092_3_.nextInt(Rotation.values().length)];
ChunkPrimer chunkprimer = new ChunkPrimer();
p_191092_2_.setBlocksInChunk(p_191092_4_, p_191092_5_, chunkprimer);
int i = 5;
int j = 5;
if (rotation == Rotation.CLOCKWISE_90)
{
i = -5;
}
else if (rotation == Rotation.CLOCKWISE_180)
{
i = -5;
j = -5;
}
else if (rotation == Rotation.COUNTERCLOCKWISE_90)
{
j = -5;
}
int k = chunkprimer.findGroundBlockIdx(7, 7);
int l = chunkprimer.findGroundBlockIdx(7, 7 + j);
int i1 = chunkprimer.findGroundBlockIdx(7 + i, 7);
int j1 = chunkprimer.findGroundBlockIdx(7 + i, 7 + j);
int k1 = Math.min(Math.min(k, l), Math.min(i1, j1));
if (k1 < 60)
{
this.field_191093_c = false;
}
else
{
BlockPos blockpos = new BlockPos(p_191092_4_ * 16 + 8, k1 + 1, p_191092_5_ * 16 + 8);
List<WoodlandMansionPieces.MansionTemplate> list = Lists.<WoodlandMansionPieces.MansionTemplate>newLinkedList();
WoodlandMansionPieces.func_191152_a(p_191092_1_.getSaveHandler().getStructureTemplateManager(), blockpos, rotation, list, p_191092_3_);
this.components.addAll(list);
this.updateBoundingBox();
this.field_191093_c = true;
}
}