下面列出了net.minecraft.util.math.BlockPos#toImmutable ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
public TreeChopTask(BlockPos startPos, World world, EntityPlayerMP player, ItemStack toolStack) {
this.startBlockPos = startPos.toImmutable();
this.currentPos.setPos(startPos);
this.woodBlockPos.add(startPos.toImmutable());
this.world = world;
this.itemStack = toolStack.copy();
this.player = player;
}
@Override
public void debugActionBlockClicked(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
pos = pos.toImmutable();
for (int x = -radius; x < radius; x++) {
for (int z = -radius; z < radius; z++) {
BlockPos loc = pos.add(x, 0, z);
Block block = world.getBlockState(loc).getBlock();
if (block instanceof BlockBush) {
world.destroyBlock(loc, false);
}
}
}
}