Java Code Examples for net.minecraft.util.math.BlockPos#toImmutable()

The following examples show how to use net.minecraft.util.math.BlockPos#toImmutable() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TreeChopTask.java    From GregTech with GNU Lesser General Public License v3.0 5 votes vote down vote up
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;
}
 
Example 2
Source File: DebugModeClearGrass.java    From AgriCraft with MIT License 5 votes vote down vote up
@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);
            }
        }
    }
}