Guest User

Untitled

a guest
Jan 20th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. // Redstone fence gates
  2. Block block = event.getBlock();
  3. for(BlockFace face: BlockFace.values()) {
  4. faceBlock = block.getRelative(face);
  5. if (faceBlock.getType() == Material.FENCE_GATE) {
  6. byte data = faceBlock.getData();
  7. if (block.isBlockPowered() || block.isBlockIndirectlyPowered()) {
  8. if (ra.contains(block.getLocation)) { continue; }
  9. ra.add(block.getLocation());
  10. data += 4;
  11. } else {
  12. ra.remove(block.getLocation());
  13. data -= 4;
  14. }
  15. faceBlock.setData(data);
  16. }
  17. }
Add Comment
Please, Sign In to add comment