示例#1
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);
    }
  }
示例#2
0
  public static boolean isDisabled(Object universe, Object inform) {
    UConf uconf = UConf.get(universe);
    if (uconf.enabled) return false;

    if (inform instanceof CommandSender) {
      ((CommandSender) inform).sendMessage(getDisabledMessage(universe));
    } else if (inform instanceof SenderEntity) {
      ((SenderEntity<?>) inform).sendMessage(getDisabledMessage(universe));
    }

    return true;
  }
示例#3
0
 public static String getDisabledMessage(Object universe) {
   UConf uconf = UConf.get(universe);
   return Txt.parse("<i>Factions are disabled in the <h>%s <i>universe.", uconf.getUniverse());
 }