Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Redstone fence gates
- Block bl = event.getBlock();
- for(BlockFace bf: BlockFace.values()) {
- Block isfencegate = bl.getRelative(bf);
- if(isfencegate.getType() == Material.FENCE_GATE) {
- if(bl.isBlockPowered() || bl.isBlockIndirectlyPowered()) {
- if(!ra.contains(bl.getLocation())) {
- if(isfencegate.getData() <= 3) {
- byte fb = isfencegate.getData();
- fb += 4;
- isfencegate.setData(fb);
- }
- ra.add(bl.getLocation());
- }
- } else {
- if(ra.contains(bl.getLocation())) {
- if(isfencegate.getData() >= 4) {
- byte fb = isfencegate.getData();
- fb -= 4;
- isfencegate.setData(fb);
- }
- ra.remove(bl.getLocation());
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment