本文整理汇总了Java中net.minecraft.world.World.notifyBlockOfNeighborChange方法的典型用法代码示例。如果您正苦于以下问题:Java World.notifyBlockOfNeighborChange方法的具体用法?Java World.notifyBlockOfNeighborChange怎么用?Java World.notifyBlockOfNeighborChange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.World
的用法示例。
在下文中一共展示了World.notifyBlockOfNeighborChange方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: absorb
import net.minecraft.world.World; //导入方法依赖的package包/类
private boolean absorb(World world, int x, int y, int z) {
LinkedList<Tuple> linkedlist = Lists.newLinkedList();
ArrayList<WorldCoord> arraylist = Lists.newArrayList();
linkedlist.add(new Tuple(new WorldCoord(x, y, z), 0));
int i = 0;
WorldCoord blockpos1;
while (!linkedlist.isEmpty()) {
Tuple tuple = linkedlist.poll();
blockpos1 = (WorldCoord) tuple.getFirst();
int j = (Integer) tuple.getSecond();
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
WorldCoord blockpos2 = blockpos1.add(dir);
if (world.getBlock(blockpos2.x, blockpos2.y, blockpos2.z).getMaterial() == Material.water) {
world.setBlockToAir(blockpos2.x, blockpos2.y, blockpos2.z);
arraylist.add(blockpos2);
i++;
if (j < 6)
linkedlist.add(new Tuple(blockpos2, j + 1));
}
}
if (i > 64)
break;
}
Iterator<WorldCoord> iterator = arraylist.iterator();
while (iterator.hasNext()) {
blockpos1 = iterator.next();
world.notifyBlockOfNeighborChange(blockpos1.x, blockpos1.y, blockpos1.z, Blocks.air);
}
return i > 0;
}