Exemplo n.º 1
0
 @Override
 public void onPlayerRightClickSign(PlayerEvent event) {
   String activator = event.getMechanicIdentifier();
   BlockFace direction =
       activator.equals("[Lift Up]")
           ? BlockFace.UP
           : (activator.equals("[Lift Down]") ? BlockFace.DOWN : null);
   int maxSearchHeight = config.getMaxSearchHeight();
   if (direction == BlockFace.DOWN || direction == BlockFace.UP) {
     Block block;
     for (int dy = 1; dy < maxSearchHeight; dy++) {
       block = event.getBlock().getRelative(0, (direction == BlockFace.UP ? dy : -dy), 0);
       if (SignUtil.isSign(block)) {
         String id = SignUtil.getMechanicsIdentifier(SignUtil.getSign(block));
         if (id.equals("[Lift]") || id.equals("[Lift Up]") || id.equals("[Lift Down]")) {
           movePlayer(block, event.getPlayer());
         }
       }
     }
   }
 }
Exemplo n.º 2
0
 @Override
 public boolean isEnabled() {
   return config.isEnabled();
 }