本文整理汇总了Java中net.minecraft.world.chunk.Chunk.getAreLevelsEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java Chunk.getAreLevelsEmpty方法的具体用法?Java Chunk.getAreLevelsEmpty怎么用?Java Chunk.getAreLevelsEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.chunk.Chunk
的用法示例。
在下文中一共展示了Chunk.getAreLevelsEmpty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ChunkCache
import net.minecraft.world.chunk.Chunk; //导入方法依赖的package包/类
public ChunkCache(World worldIn, BlockPos posFromIn, BlockPos posToIn, int subIn)
{
this.worldObj = worldIn;
this.chunkX = posFromIn.getX() - subIn >> 4;
this.chunkZ = posFromIn.getZ() - subIn >> 4;
int i = posToIn.getX() + subIn >> 4;
int j = posToIn.getZ() + subIn >> 4;
this.chunkArray = new Chunk[i - this.chunkX + 1][j - this.chunkZ + 1];
this.hasExtendedLevels = true;
for (int k = this.chunkX; k <= i; ++k)
{
for (int l = this.chunkZ; l <= j; ++l)
{
this.chunkArray[k - this.chunkX][l - this.chunkZ] = worldIn.getChunkFromChunkCoords(k, l);
}
}
for (int i1 = posFromIn.getX() >> 4; i1 <= posToIn.getX() >> 4; ++i1)
{
for (int j1 = posFromIn.getZ() >> 4; j1 <= posToIn.getZ() >> 4; ++j1)
{
Chunk chunk = this.chunkArray[i1 - this.chunkX][j1 - this.chunkZ];
if (chunk != null && !chunk.getAreLevelsEmpty(posFromIn.getY(), posToIn.getY()))
{
this.hasExtendedLevels = false;
}
}
}
}