daily pastebin goal
32%
SHARE
TWEET

Untitled

a guest Jan 20th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Redstone fence gates
  2.         Block bl = event.getBlock();
  3.         for(BlockFace bf: BlockFace.values()) {
  4.              Block isfencegate = bl.getRelative(bf);
  5.             if(isfencegate.getType() == Material.FENCE_GATE) {
  6.                 if(bl.isBlockPowered() || bl.isBlockIndirectlyPowered()) {
  7.                     if(!ra.contains(bl.getLocation())) {
  8.                         if(isfencegate.getData() <= 3) {
  9.                             byte fb = isfencegate.getData();
  10.                             fb += 4;
  11.                             isfencegate.setData(fb);
  12.                         }
  13.                         ra.add(bl.getLocation());
  14.                     }
  15.                 } else {
  16.                     if(ra.contains(bl.getLocation())) {
  17.                         if(isfencegate.getData() >= 4) {
  18.                             byte fb = isfencegate.getData();
  19.                             fb -= 4;
  20.                             isfencegate.setData(fb);
  21.                         }
  22.                         ra.remove(bl.getLocation());
  23.                     }
  24.                 }
  25.             }
  26.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top