Exemplo n.º 1
0
 public boolean prepare() {
   cancelPrevious();
   Block block =
       BlockSource.getSourceBlock(player, range, BlockSourceType.LAVA, ClickType.LEFT_CLICK);
   if (block != null) {
     sourceBlock = block;
     focusBlock();
     return true;
   }
   return false;
 }
 public boolean prepare() {
   cancelPrevious();
   Block block = BlockSource.getEarthSourceBlock(player, range, ClickType.SHIFT_DOWN);
   block(player);
   if (block != null) {
     if (block.getLocation().distance(player.getLocation()) > preparerange) {
       return false;
     }
     sourceblock = block;
     focusBlock();
     return true;
   }
   return false;
 }
Exemplo n.º 3
0
  public IceBlast(Player player) {
    if (!WaterMethods.canIcebend(player)) return;
    BendingPlayer bPlayer = GeneralMethods.getBendingPlayer(player.getName());
    if (bPlayer.isOnCooldown("IceBlast")) {
      return;
    }

    block(player);
    range = WaterMethods.waterbendingNightAugment(defaultrange, player.getWorld());
    this.player = player;
    Block sourceblock =
        BlockSource.getWaterSourceBlock(player, range, ClickType.SHIFT_DOWN, false, true, false);

    if (sourceblock == null) {
      return;
    } else if (TempBlock.isTempBlock(sourceblock)) {
      return;
    } else {
      prepare(sourceblock);
    }
  }
Exemplo n.º 4
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;
      }
    }
  }