Package com.bergerkiller.bukkit.tc.utils

Examples of com.bergerkiller.bukkit.tc.utils.Effect


  @Override
  public void execute(SignActionEvent info) {
    boolean move = info.isType("meffect");
    if (!info.isPowered()) return;
    Effect eff = parse(info);
    if (info.isAction(SignActionType.MEMBER_MOVE)) {
      if (move) {
        if (info.isTrainSign()) {
          for (MinecartMember<?> member : info.getGroup()) {
            eff.play(member.getEntity().getLocation());
          }
        } else if (info.isCartSign()) {
          eff.play(info.getMember().getEntity().getLocation());
        }
      }
      return;
    }
    if (info.isTrainSign() && info.isAction(SignActionType.REDSTONE_ON, SignActionType.GROUP_ENTER) && info.hasGroup()) {
      for (MinecartMember<?> member : info.getGroup()) {
        eff.play(member.getEntity().getLocation());
      }
    } else if (info.isCartSign() && info.isAction(SignActionType.REDSTONE_ON, SignActionType.MEMBER_ENTER) && info.hasMember()) {
      eff.play(info.getMember().getEntity().getLocation());
    } else if (info.isRCSign() && info.isAction(SignActionType.REDSTONE_ON)) {
      for (MinecartGroup group : info.getRCTrainGroups()) {
        for (MinecartMember<?> member : group) {
          eff.play(member.getEntity().getLocation());
        }
      }
    } else if (info.isAction(SignActionType.REDSTONE_ON)) {
      if (info.hasRails()) {
        eff.play(info.getCenterLocation());
      } else {
        eff.play(info.getLocation().add(0.0, 2.0, 0.0));
      }
    }
  }
View Full Code Here


  public boolean canSupportRC() {
    return true;
  }

  public static Effect parse(SignActionEvent event) {
    Effect eff = new Effect();
    eff.parseEffect(event.getLine(2));
    eff.parseEffect(event.getLine(3));
    String[] args = StringUtil.getAfter(event.getLine(1), " ").trim().split(" ", -1);
    try {
      if (args.length >= 1) {
        eff.pitch = (float) ParseUtil.parseDouble(args[0], 1.0);
      }
View Full Code Here

TOP

Related Classes of com.bergerkiller.bukkit.tc.utils.Effect

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.