Пример #1
0
  @Override
  public void performfp() {
    if (!FactionsPlus.permission.has(sender, "factionsplus.clearlwclocks")) {
      sender.sendMessage(ChatColor.RED + "You don't have permission to use this command!");
      return;
    }

    Location loc = Utilities.getOnlinePlayerExact(usender).getLocation();
    Player name = Utilities.getOnlinePlayerExact(usender);

    int lwc_clearedlocks = LWCFunctions.clearLocksCommand(name, loc);

    int clearedlocks = 0;

    if (lwc_clearedlocks < 0) {

      lwc_clearedlocks = 0;
    }

    clearedlocks += lwc_clearedlocks;

    if (clearedlocks == 0) {
      name.sendMessage(ChatColor.GOLD + "No unlockable protections were found in this chunk");
      return;
    }

    name.sendMessage(
        ChatColor.GOLD + "Successfully removed " + clearedlocks + " protections from this chunk");
  }
Пример #2
0
  /**
   * @param Cost of action
   * @param because Mark did x
   * @param UPlayer
   * @return boolean
   */
  public static boolean doFinanceCrap(double cost, String sinceDidX, UPlayer player) {
    if (!Config._economy.isHooked()
        || !UConf.get(player).econEnabled
        || Utilities.getOnlinePlayerExact(player) == null
        || cost == 0.0) {
      return true;
    }

    if (UConf.get(player).bankEnabled
        && UConf.get(player).bankFactionPaysCosts
        && player.hasFaction()) {
      return Econ.modifyMoney(player.getFaction(), -cost, sinceDidX);
    } else {
      return Econ.modifyMoney(player, -cost, sinceDidX);
    }
  }
Пример #3
0
 public static boolean isOp(UPlayer uPlayer) {
   return Utilities.getOnlinePlayerExact(uPlayer).isOp();
 }
Пример #4
0
 /**
  * @param fplayer
  * @return null if offline
  */
 public static final Player getOnlinePlayerExact(UPlayer uPlayer) {
   if (null == uPlayer) {
     return null;
   }
   return Utilities.getOnlinePlayerExact(uPlayer.getId());
 }