コード例 #1
0
ファイル: Utilities.java プロジェクト: roastnewt/FactionsPlus
  /**
   * @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
ファイル: UConf.java プロジェクト: EquinoxEarth/Factions
  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
ファイル: UConf.java プロジェクト: EquinoxEarth/Factions
 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());
 }