本文整理匯總了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;
}