Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Check for double-chest
- LinkedList<Block> directions = new LinkedList<Block>();
- directions.add(block.getRelative(BlockFace.NORTH));
- directions.add(block.getRelative(BlockFace.SOUTH));
- directions.add(block.getRelative(BlockFace.EAST));
- directions.add(block.getRelative(BlockFace.WEST));
- for (Block b : directions) {
- state = b.getState();
- if (state.getType() == org.bukkit.Material.CHEST) {
- contents = ((Chest) state).getInventory();
- for (ItemStack items : contents.getContents()) {
- if (items != null && items.getType() == Material.SAND) {
- sand += items.getAmount();
- }
- }
- }
- break;
- }
- }
Add Comment
Please, Sign In to add comment