Java Code Examples for net.minecraft.block.Block#addCollisionBoxToList()
The following examples show how to use
net.minecraft.block.Block#addCollisionBoxToList() .
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: BlockWaterChannelValve.java From AgriCraft with MIT License | 5 votes |
@Override @SideOnly(Side.CLIENT) @SuppressWarnings("deprecation") public void addCollisionBoxToList(IBlockState state, World world, BlockPos pos, AxisAlignedBB mask, List<AxisAlignedBB> list, @Nullable Entity entity, boolean isActualState) { // Add central box. addCollisionBoxToList(pos, mask, list, CENTER_BOX); // Fetch Tile Entity final TileEntityChannelValve tile = WorldHelper.getTile(world, pos, TileEntityChannelValve.class).orElse(null); // If null stop. if (tile == null) { return; } //adjacent boxes if (tile.getConnections().get(EnumFacing.NORTH) > 0) { Block.addCollisionBoxToList(pos, mask, list, NORTH_BOX); } if (tile.getConnections().get(EnumFacing.EAST) > 0) { Block.addCollisionBoxToList(pos, mask, list, EAST_BOX); } if (tile.getConnections().get(EnumFacing.SOUTH) > 0) { Block.addCollisionBoxToList(pos, mask, list, SOUTH_BOX); } if (tile.getConnections().get(EnumFacing.WEST) > 0) { Block.addCollisionBoxToList(pos, mask, list, WEST_BOX); } }
Example 2
Source File: BlockSprinkler.java From AgriCraft with MIT License | 5 votes |
@Override @SideOnly(Side.CLIENT) @SuppressWarnings("deprecation") public void addCollisionBoxToList(IBlockState state, World world, BlockPos pos, AxisAlignedBB mask, List<AxisAlignedBB> list, @Nullable Entity entity, boolean isActualState) { // Add central box. Block.addCollisionBoxToList(pos, mask, list, BOUNDS_SPRINKLER); }
Example 3
Source File: BlockWaterChannel.java From AgriCraft with MIT License | 5 votes |
@Override @SideOnly(Side.CLIENT) @SuppressWarnings("deprecation") public void addCollisionBoxToList(IBlockState state, World world, BlockPos pos, AxisAlignedBB mask, List<AxisAlignedBB> list, @Nullable Entity entity, boolean isActualState) { // Add central box. addCollisionBoxToList(pos, mask, list, CENTER_BOX); // Fetch Tile Entity final TileEntityChannel tile = WorldHelper.getTile(world, pos, TileEntityChannel.class).orElse(null); // If null stop. if (tile == null) { return; } //adjacent boxes if (tile.getConnections().get(EnumFacing.NORTH) > 0) { Block.addCollisionBoxToList(pos, mask, list, NORTH_BOX); } if (tile.getConnections().get(EnumFacing.EAST) > 0) { Block.addCollisionBoxToList(pos, mask, list, EAST_BOX); } if (tile.getConnections().get(EnumFacing.SOUTH) > 0) { Block.addCollisionBoxToList(pos, mask, list, SOUTH_BOX); } if (tile.getConnections().get(EnumFacing.WEST) > 0) { Block.addCollisionBoxToList(pos, mask, list, WEST_BOX); } }