Java Code Examples for net.minecraft.world.WorldServer#isAirBlock()
The following examples show how to use
net.minecraft.world.WorldServer#isAirBlock() .
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: EntityBlock.java From OpenModsLib with MIT License | 6 votes |
private boolean tryPlaceBlock(EntityPlayer player, WorldServer world, BlockPos pos, EnumFacing fromSide) { if (!world.isAirBlock(pos)) return false; boolean blockPlaced = new BlockManipulator(world, player, pos).place(blockState, fromSide, EnumHand.MAIN_HAND); if (!blockPlaced) return false; if (tileEntity != null) { tileEntity.setInteger("x", pos.getX()); tileEntity.setInteger("y", pos.getY()); tileEntity.setInteger("z", pos.getZ()); TileEntity te = world.getTileEntity(pos); te.readFromNBT(tileEntity); } return true; }