本文整理汇总了Java中net.minecraft.world.World.getChunkFromChunkCoords方法的典型用法代码示例。如果您正苦于以下问题:Java World.getChunkFromChunkCoords方法的具体用法?Java World.getChunkFromChunkCoords怎么用?Java World.getChunkFromChunkCoords使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.World
的用法示例。
在下文中一共展示了World.getChunkFromChunkCoords方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: affectChunk
import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public void affectChunk(World world) {
Chunk chunk = world.getChunkFromChunkCoords(chunkPos.x, chunkPos.z);
for (int i = 0; i < chunk.getEntityLists().length; i++) {
if (chunk.getEntityLists()[i] != null) {
for (EntityAnimal e : chunk.getEntityLists()[i].getByClass(EntityAnimal.class)) {
if (world.rand.nextInt(3) == 0) {
e.addTag(TAG);
}
}
}
}
}
示例2: isChunkAdjacentToTerritory
import net.minecraft.world.World; //导入方法依赖的package包/类
public static boolean isChunkAdjacentToTerritory(World world, UUID factionID, Chunk chunk)
{
if (factionID == null) { return false; }
if (chunk == null) { return false; }
_FactionSaveData faction = saveData.getFactionMap().get(factionID);
if (faction == null) { return false; } // No faction with that ID exists.
// Once round
Chunk tempChunk = world.getChunkFromChunkCoords(chunk.xPosition + 1, chunk.zPosition);
if (tempChunk != null && faction.isChunkClaimed(tempChunk.getChunkCoordIntPair())) { return true; } // Checks out.
tempChunk = world.getChunkFromChunkCoords(chunk.xPosition - 1, chunk.zPosition);
if (tempChunk != null && faction.isChunkClaimed(tempChunk.getChunkCoordIntPair())) { return true; } // Checks out.
tempChunk = world.getChunkFromChunkCoords(chunk.xPosition, chunk.zPosition + 1);
if (tempChunk != null && faction.isChunkClaimed(tempChunk.getChunkCoordIntPair())) { return true; } // Checks out.
tempChunk = world.getChunkFromChunkCoords(chunk.xPosition, chunk.zPosition - 1);
if (tempChunk != null && faction.isChunkClaimed(tempChunk.getChunkCoordIntPair())) { return true; } // Checks out.
return false;
}
示例3: getChunkFromBlockCoords
import net.minecraft.world.World; //导入方法依赖的package包/类
public static Chunk getChunkFromBlockCoords(World world, int x, int z) {
return world.getChunkFromChunkCoords(x >> 4, z >> 4);
}
示例4: getChunk
import net.minecraft.world.World; //导入方法依赖的package包/类
private static Chunk getChunk(World worldIn, Vec3d vec3)
{
return worldIn.getChunkFromChunkCoords(MathHelper.floor(vec3.xCoord / 16.0D), MathHelper.floor(vec3.zCoord / 16.0D));
}
示例5: getChunk
import net.minecraft.world.World; //导入方法依赖的package包/类
private static Chunk getChunk(World worldIn, Vec3d vec3)
{
return worldIn.getChunkFromChunkCoords(MathHelper.floor_double(vec3.xCoord / 16.0D), MathHelper.floor_double(vec3.zCoord / 16.0D));
}