Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public boolean canBlockStay(World world, int x, int y, int z)
- {
- if (world.getTileEntity(x, y, z) instanceof TELeatherRack)
- {
- TELeatherRack te = (TELeatherRack) world.getTileEntity(x, y, z);
- if (te.leatherItem == null) // Leather racks that have no hide should not exist.
- {
- return false;
- }
- }
- return world.getBlock(x, y - 1, z).getMaterial() == Material.wood; // Leather racks without a log underneath should not exist.
- }
- @Override
- public void onNeighborBlockChange(World world, int i, int j, int k, Block par5)
- {
- super.onNeighborBlockChange(world, i, j, k, par5);
- if(!canBlockStay(world,i,j,k))
- world.setBlockToAir(i, j, k);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement