Examples of SignChangeActionEvent


Examples of com.bergerkiller.bukkit.tc.events.SignChangeActionEvent

    }
    return false;
  }

  public static void handleBuild(SignChangeEvent event) {
    final SignChangeActionEvent info = new SignChangeActionEvent(event);
    SignAction action = getSignAction(info);
    if (action != null) {
      if (action.build(info)) {
        if (!action.canSupportRC() && info.isRCSign()) {
          event.getPlayer().sendMessage(ChatColor.RED + "This sign does not support remote control!");
          if (event.getLine(0).startsWith("[!")) {
            event.setLine(0, "[!train]");
          } else {
            event.setLine(0, "[train]");
          }
        }
        // Tell train above to update signs, if available
        if (info.hasRails()) {
          final MinecartMember<?> member = MinecartMemberStore.getAt(info.getRails());
          if (member != null) {
            member.getGroup().getBlockTracker().updatePosition();
          }
        }
      } else {
        event.setCancelled(true);
      }
      if (event.isCancelled()) {
        return;
      }
    }
    if (info.getMode() != SignActionMode.NONE && event.getBlock().getType() == Material.SIGN_POST) {
      //snap to fixed 45-degree angle
      BlockFace facing = BlockUtil.getFacing(event.getBlock());
      BlockUtil.setFacing(event.getBlock(), Util.snapFace(facing));
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.