Package com.bergerkiller.bukkit.tc.events

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


  public boolean isPowered(SignActionEvent info) {
    return info.isPoweredRaw(false);
  }

  public void updateRedstonePower(final Block signblock) {
    final SignActionEvent info = new SignActionEvent(signblock);
    SignAction.executeAll(info, SignActionType.REDSTONE_CHANGE);
    // Do not proceed if the sign disallows on/off changes
    if (info.isPowerAlwaysOn() || ignoredSigns.remove(signblock)) {
      return;
    }
    // Update power level
    setRedstonePower(info, isPowered(info));
  }
View Full Code Here


    // Update power level
    setRedstonePower(info, isPowered(info));
  }

  public void updateRedstonePower(final Block signblock, boolean isPowered) {
    final SignActionEvent info = new SignActionEvent(signblock);
    SignAction.executeAll(info, SignActionType.REDSTONE_CHANGE);
    // Do not proceed if the sign disallows on/off changes
    if (info.isPowerAlwaysOn() || ignoredSigns.remove(signblock)) {
      return;
    }

    // Validate with the SignActionEvent whether the power state is correct
    if (isPowered(info) != isPowered) {
View Full Code Here

      if (!prop.hasOwnership(player)) {
        continue;
      }
      if (prop.hasHolder() && statement.length() > 0) {
        MinecartGroup group = prop.getHolder();
        SignActionEvent event = new SignActionEvent(null, group);
        if (!Statement.has(group, statement, event)) {
          continue;
        }
      }
      found = true;
View Full Code Here

    }
  }

  public void onLeave(MinecartGroup group) {
    if (this.wasDown) {
      SignActionEvent event = getSignEvent(group.getWorld());
      if (event != null && event.isTrainSign() && isDown(event, null, group)) {
        this.wasDown = updateGroups(event);
      }
    }
  }
View Full Code Here

    }
  }

  public void onEnter(MinecartGroup group) {
    if (!this.wasDown) {
      SignActionEvent event = getSignEvent(group.getWorld());
      if (event != null && event.isTrainSign() && isDown(event, null, group)) {
        this.wasDown = true;
        event.setLevers(true);
      }
    }
  }
View Full Code Here

    }
  }

  public void onLeave(MinecartMember<?> member) {
    if (this.wasDown) {
      SignActionEvent event = getSignEvent(member.getEntity().getWorld());
      if (event != null && event.isCartSign() && isDown(event, member, null)) {
        this.wasDown = updateMembers(event);
      }
    }
  }
View Full Code Here

    }
  }

  public void onEnter(MinecartMember<?> member) {
    if (!this.wasDown) {
      SignActionEvent event = getSignEvent(member.getEntity().getWorld());
      if (event != null && event.isCartSign() && isDown(event, member, null)) {
        this.wasDown = true;
        event.setLevers(true);
      }
    }
  }
View Full Code Here

    event.setLevers(false);
    return false;
  }

  public void onUpdate(MinecartMember<?> member) {
    SignActionEvent event = this.getSignEvent(member.getEntity().getWorld());
    if (event != null) this.updateMembers(event);
  }
View Full Code Here

    SignActionEvent event = this.getSignEvent(member.getEntity().getWorld());
    if (event != null) this.updateMembers(event);
  }

  public void onUpdate(MinecartGroup group) {
    SignActionEvent event = this.getSignEvent(group.getWorld());
    if (event != null) this.updateMembers(event);
  }
View Full Code Here

   * @param clickedSign
   * @param player that clicked
   * @return Whether the click was handled (and the original interaction should be cancelled)
   */
  public static boolean handleClick(Block clickedSign, Player player) {
    SignActionEvent info = new SignActionEvent(clickedSign);
    if (info.getSign() == null) {
      return false;
    }
    SignAction action = getSignAction(info);
    return action != null && action.click(info, player);
  }
View Full Code Here

TOP

Related Classes of com.bergerkiller.bukkit.tc.events.SignActionEvent

Copyright © 2018 www.massapicom. 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.