Пример #1
0
  public EarthColumn(Player player, Location origin) {
    this.origin = origin;
    location = origin.clone();
    block = location.getBlock();
    this.player = player;
    distance =
        EarthMethods.getEarthbendableBlocksLength(
            player, block, direction.clone().multiply(-1), height);

    loadAffectedBlocks();

    if (distance != 0) {
      if (canInstantiate()) {
        id = ID;
        instances.put(id, this);
        if (ID >= Integer.MAX_VALUE) {
          ID = Integer.MIN_VALUE;
        }
        ID++;
        time = System.currentTimeMillis() - interval;
      }
    }
  }
Пример #2
0
  public EarthColumn(Player player) {
    BendingPlayer bPlayer = GeneralMethods.getBendingPlayer(player.getName());

    if (bPlayer.isOnCooldown("RaiseEarth")) return;

    try {
      if (AvatarState.isAvatarState(player)) {
        height = (int) (2. / 5. * (double) AvatarState.getValue(height));
      }
      block = BlockSource.getEarthSourceBlock(player, range, ClickType.LEFT_CLICK);
      if (block == null) return;
      origin = block.getLocation();
      location = origin.clone();
      distance =
          EarthMethods.getEarthbendableBlocksLength(
              player, block, direction.clone().multiply(-1), height);
    } catch (IllegalStateException e) {
      return;
    }

    this.player = player;

    loadAffectedBlocks();

    if (distance != 0) {
      if (canInstantiate()) {
        id = ID;
        instances.put(id, this);
        bPlayer.addCooldown("RaiseEarth", GeneralMethods.getGlobalCooldown());
        if (ID >= Integer.MAX_VALUE) {
          ID = Integer.MIN_VALUE;
        }
        ID++;
        time = System.currentTimeMillis() - interval;
      }
    }
  }