Example #1
0
  /**
   * Check when a player deposits fire and add it to list
   *
   * @param event the events
   * @param player the player
   */
  private void checkForPvpFire(BlockEvent event, Player player) {

    ApiPlayerConfEntry entry;

    if (player != null && (entry = playerConf.get(player)) != null) {

      Location loc = event.getBlock().getLocation();
      ApiDummyLand land = Secuboid.getThisPlugin().getLands().getLandOrOutsideArea(loc);

      if (land.getFlagAndInherit(FlagList.FULL_PVP.getFlagType()).getValueBoolean() == false
          || land.getFlagAndInherit(FlagList.FULL_PVP.getFlagType()).getValueBoolean() == false) {

        // Add fire for pvp listen
        playerFireLocation.put(loc, entry.getPlayerContainer());
      }
    }
  }
Example #2
0
  /**
   * Checks if pvp is valid.
   *
   * @param land the land
   * @param attacker the attacker
   * @param victim the victim
   * @return true, if is pvp valid
   */
  private boolean isPvpValid(
      ApiDummyLand land, ApiPlayerContainerPlayer attacker, ApiPlayerContainerPlayer victim) {

    if (land.getFlagAndInherit(FlagList.FULL_PVP.getFlagType()).getValueBoolean() == false) {
      return false;
    }

    return true;
  }