From 1b0c0a4b72620d31adcf4a9e5e0aee6d93012a4e Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Tue, 9 Apr 2013 13:15:25 +0200 Subject: [PATCH] Rename Conf --> ConfServer. --- src/com/massivecraft/factions/Board.java | 12 +-- .../factions/{Conf.java => ConfServer.java} | 6 +- src/com/massivecraft/factions/FPlayer.java | 74 +++++++++---------- src/com/massivecraft/factions/FPlayers.java | 6 +- src/com/massivecraft/factions/Faction.java | 20 ++--- .../massivecraft/factions/FactionColl.java | 10 +-- src/com/massivecraft/factions/Factions.java | 24 +++--- .../massivecraft/factions/cmd/CmdClaim.java | 4 +- .../massivecraft/factions/cmd/CmdConfig.java | 8 +- .../massivecraft/factions/cmd/CmdCreate.java | 8 +- .../factions/cmd/CmdDescription.java | 6 +- .../massivecraft/factions/cmd/CmdDisband.java | 4 +- .../massivecraft/factions/cmd/CmdHelp.java | 4 +- .../massivecraft/factions/cmd/CmdHome.java | 22 +++--- .../massivecraft/factions/cmd/CmdInvite.java | 4 +- .../massivecraft/factions/cmd/CmdJoin.java | 16 ++-- .../massivecraft/factions/cmd/CmdKick.java | 10 +-- .../massivecraft/factions/cmd/CmdList.java | 4 +- src/com/massivecraft/factions/cmd/CmdMap.java | 6 +- .../factions/cmd/CmdMoneyDeposit.java | 4 +- .../factions/cmd/CmdMoneyTransferFf.java | 4 +- .../factions/cmd/CmdMoneyTransferFp.java | 4 +- .../factions/cmd/CmdMoneyTransferPf.java | 4 +- .../factions/cmd/CmdMoneyWithdraw.java | 4 +- .../massivecraft/factions/cmd/CmdOpen.java | 4 +- .../massivecraft/factions/cmd/CmdPower.java | 4 +- .../massivecraft/factions/cmd/CmdReload.java | 6 +- .../massivecraft/factions/cmd/CmdSaveAll.java | 4 +- .../massivecraft/factions/cmd/CmdSethome.java | 8 +- .../massivecraft/factions/cmd/CmdShow.java | 8 +- src/com/massivecraft/factions/cmd/CmdTag.java | 8 +- .../massivecraft/factions/cmd/CmdTitle.java | 6 +- .../massivecraft/factions/cmd/CmdUnclaim.java | 6 +- .../factions/cmd/CmdUnclaimall.java | 6 +- .../massivecraft/factions/cmd/FCmdRoot.java | 4 +- .../massivecraft/factions/cmd/FCommand.java | 10 +-- .../factions/cmd/FRelationCommand.java | 4 +- .../factions/integration/Econ.java | 26 +++---- .../integration/EssentialsFeatures.java | 6 +- .../factions/integration/LWCFeatures.java | 6 +- .../factions/integration/SpoutFeatures.java | 12 +-- .../integration/SpoutMainListener.java | 32 ++++---- .../integration/herochat/AlliesChannel.java | 38 +++++----- .../integration/herochat/FactionChannel.java | 38 +++++----- .../herochat/HerochatListener.java | 6 +- .../listeners/FactionsAppearanceListener.java | 4 +- .../listeners/FactionsBlockListener.java | 10 +-- .../listeners/FactionsChatListener.java | 14 ++-- .../listeners/FactionsEntityListener.java | 30 ++++---- .../listeners/FactionsExploitListener.java | 6 +- .../listeners/FactionsPlayerListener.java | 32 ++++---- .../massivecraft/factions/struct/FFlag.java | 4 +- .../massivecraft/factions/struct/FPerm.java | 4 +- src/com/massivecraft/factions/struct/Rel.java | 28 +++---- .../factions/util/AutoLeaveTask.java | 6 +- .../factions/util/EconLandRewardTask.java | 6 +- .../factions/util/HealthBarUtil.java | 10 +-- .../factions/util/RelationUtil.java | 6 +- 58 files changed, 335 insertions(+), 335 deletions(-) rename src/com/massivecraft/factions/{Conf.java => ConfServer.java} (99%) diff --git a/src/com/massivecraft/factions/Board.java b/src/com/massivecraft/factions/Board.java index 2c428d45..d02f2dbd 100644 --- a/src/com/massivecraft/factions/Board.java +++ b/src/com/massivecraft/factions/Board.java @@ -73,7 +73,7 @@ public class Board public static void removeAt(FLocation flocation) { - if(Conf.onUnclaimResetLwcLocks && LWCFeatures.getEnabled()) + if(ConfServer.onUnclaimResetLwcLocks && LWCFeatures.getEnabled()) LWCFeatures.clearAllChests(flocation); flocationIds.remove(flocation); @@ -87,7 +87,7 @@ public class Board Entry entry = iter.next(); if (entry.getValue().getHostFactionID().equals(factionId)) { - if(Conf.onUnclaimResetLwcLocks && LWCFeatures.getEnabled()) + if(ConfServer.onUnclaimResetLwcLocks && LWCFeatures.getEnabled()) LWCFeatures.clearAllChests(entry.getKey()); iter.remove(); @@ -129,7 +129,7 @@ public class Board Entry entry = iter.next(); if ( ! FactionColl.i.exists(entry.getValue().getHostFactionID())) { - if(Conf.onUnclaimResetLwcLocks && LWCFeatures.getEnabled()) + if(ConfServer.onUnclaimResetLwcLocks && LWCFeatures.getEnabled()) LWCFeatures.clearAllChests(entry.getKey()); Factions.get().log("Board cleaner removed "+entry.getValue().getHostFactionID()+" from "+entry.getKey()); @@ -190,8 +190,8 @@ public class Board Faction factionLoc = getFactionAt(flocation); ret.add(Factions.get().txt.titleize("("+flocation.getCoordString()+") "+factionLoc.getTag(observer))); - int halfWidth = Conf.mapWidth / 2; - int halfHeight = Conf.mapHeight / 2; + int halfWidth = ConfServer.mapWidth / 2; + int halfHeight = ConfServer.mapHeight / 2; FLocation topLeft = flocation.getRelative(-halfWidth, -halfHeight); int width = halfWidth * 2 + 1; int height = halfHeight * 2 + 1; @@ -225,7 +225,7 @@ public class Board else { if (!fList.containsKey(factionHere)) - fList.put(factionHere, Conf.mapKeyChrs[chrIdx++]); + fList.put(factionHere, ConfServer.mapKeyChrs[chrIdx++]); char fchar = fList.get(factionHere); row += factionHere.getColorTo(observer) + "" + fchar; } diff --git a/src/com/massivecraft/factions/Conf.java b/src/com/massivecraft/factions/ConfServer.java similarity index 99% rename from src/com/massivecraft/factions/Conf.java rename to src/com/massivecraft/factions/ConfServer.java index d619273f..5d0c8b2a 100644 --- a/src/com/massivecraft/factions/Conf.java +++ b/src/com/massivecraft/factions/ConfServer.java @@ -9,7 +9,7 @@ import com.massivecraft.factions.struct.FFlag; import com.massivecraft.factions.struct.FPerm; import com.massivecraft.factions.struct.Rel; -public class Conf +public class ConfServer { public final static transient List baseCommandAliases = new ArrayList(); @@ -344,10 +344,10 @@ public class Conf // -------------------------------------------- // // Persistance // -------------------------------------------- // - private static transient Conf i = new Conf(); + private static transient ConfServer i = new ConfServer(); public static void load() { - Factions.get().persist.loadOrSaveDefault(i, Conf.class, "conf"); + Factions.get().persist.loadOrSaveDefault(i, ConfServer.class, "conf"); } public static void save() { diff --git a/src/com/massivecraft/factions/FPlayer.java b/src/com/massivecraft/factions/FPlayer.java index 5c588e84..321f955a 100644 --- a/src/com/massivecraft/factions/FPlayer.java +++ b/src/com/massivecraft/factions/FPlayer.java @@ -110,17 +110,17 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator public FPlayer() { this.resetFactionData(false); - this.power = Conf.powerPlayerStarting; + this.power = ConfServer.powerPlayerStarting; this.lastPowerUpdateTime = System.currentTimeMillis(); this.lastLoginTime = System.currentTimeMillis(); this.mapAutoUpdating = false; this.autoClaimFor = null; - this.loginPvpDisabled = (Conf.noPVPDamageToOthersForXSecondsAfterLogin > 0) ? true : false; + this.loginPvpDisabled = (ConfServer.noPVPDamageToOthersForXSecondsAfterLogin > 0) ? true : false; this.powerBoost = 0.0; - if ( ! Conf.newPlayerStartingFactionID.equals("0") && FactionColl.i.exists(Conf.newPlayerStartingFactionID)) + if ( ! ConfServer.newPlayerStartingFactionID.equals("0") && FactionColl.i.exists(ConfServer.newPlayerStartingFactionID)) { - this.factionId = Conf.newPlayerStartingFactionID; + this.factionId = ConfServer.newPlayerStartingFactionID; } } @@ -168,7 +168,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator losePowerFromBeingOffline(); this.lastLoginTime = lastLoginTime; this.lastPowerUpdateTime = lastLoginTime; - if (Conf.noPVPDamageToOthersForXSecondsAfterLogin > 0) + if (ConfServer.noPVPDamageToOthersForXSecondsAfterLogin > 0) { this.loginPvpDisabled = true; } @@ -180,7 +180,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator { return false; } - if (this.lastLoginTime + (Conf.noPVPDamageToOthersForXSecondsAfterLogin * 1000) < System.currentTimeMillis()) + if (this.lastLoginTime + (ConfServer.noPVPDamageToOthersForXSecondsAfterLogin * 1000) < System.currentTimeMillis()) { this.loginPvpDisabled = false; return false; @@ -248,7 +248,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator return ""; } - return String.format(Conf.chatTagFormat, this.role.getPrefix()+this.getTag()); + return String.format(ConfServer.chatTagFormat, this.role.getPrefix()+this.getTag()); } // Colored Chat Tag @@ -344,12 +344,12 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator public double getPowerMax() { - return Conf.powerPlayerMax + this.powerBoost; + return ConfServer.powerPlayerMax + this.powerBoost; } public double getPowerMin() { - return Conf.powerPlayerMin + this.powerBoost; + return ConfServer.powerPlayerMin + this.powerBoost; } public int getPowerRounded() @@ -372,7 +372,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator if (this.isOffline()) { losePowerFromBeingOffline(); - if (!Conf.powerRegenOffline) + if (!ConfServer.powerRegenOffline) { return; } @@ -385,10 +385,10 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator if (thisPlayer != null && thisPlayer.isDead()) return; // don't let dead players regain power until they respawn int millisPerMinute = 60*1000; - double powerPerMinute = Conf.powerPerMinute; - if(Conf.scaleNegativePower && this.power < 0) + double powerPerMinute = ConfServer.powerPerMinute; + if(ConfServer.scaleNegativePower && this.power < 0) { - powerPerMinute += (Math.sqrt(Math.abs(this.power)) * Math.abs(this.power)) / Conf.scaleNegativeDivisor; + powerPerMinute += (Math.sqrt(Math.abs(this.power)) * Math.abs(this.power)) / ConfServer.scaleNegativeDivisor; } this.alterPower(millisPassed * powerPerMinute / millisPerMinute); @@ -396,14 +396,14 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator protected void losePowerFromBeingOffline() { - if (Conf.powerOfflineLossPerDay > 0.0 && this.power > Conf.powerOfflineLossLimit) + if (ConfServer.powerOfflineLossPerDay > 0.0 && this.power > ConfServer.powerOfflineLossLimit) { long now = System.currentTimeMillis(); long millisPassed = now - this.lastPowerUpdateTime; this.lastPowerUpdateTime = now; - double loss = millisPassed * Conf.powerOfflineLossPerDay / (24*60*60*1000); - if (this.power - loss < Conf.powerOfflineLossLimit) + double loss = millisPassed * ConfServer.powerOfflineLossPerDay / (24*60*60*1000); + if (this.power - loss < ConfServer.powerOfflineLossLimit) { loss = this.power; } @@ -414,7 +414,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator public void onDeath() { this.updatePower(); - this.alterPower(-Conf.powerPerDeath); + this.alterPower(-ConfServer.powerPerDeath); } //----------------------------------------------// @@ -484,21 +484,21 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator return; } - if (!Conf.canLeaveWithNegativePower && this.getPower() < 0) + if (!ConfServer.canLeaveWithNegativePower && this.getPower() < 0) { msg("You cannot leave until your power is positive."); return; } // if economy is enabled and they're not on the bypass list, make sure they can pay - if (makePay && ! Econ.hasAtLeast(this, Conf.econCostLeave, "to leave your faction.")) return; + if (makePay && ! Econ.hasAtLeast(this, ConfServer.econCostLeave, "to leave your faction.")) return; FPlayerLeaveEvent leaveEvent = new FPlayerLeaveEvent(this,myFaction,FPlayerLeaveEvent.PlayerLeaveReason.LEAVE); Bukkit.getServer().getPluginManager().callEvent(leaveEvent); if (leaveEvent.isCancelled()) return; // then make 'em pay (if applicable) - if (makePay && ! Econ.modifyMoney(this, -Conf.econCostLeave, "to leave your faction.", "for leaving your faction.")) return; + if (makePay && ! Econ.modifyMoney(this, -ConfServer.econCostLeave, "to leave your faction.", "for leaving your faction.")) return; // Am I the last one in the faction? if (myFaction.getFPlayers().size() == 1) @@ -515,7 +515,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator fplayer.msg("%s left %s.", this.describeTo(fplayer, true), myFaction.describeTo(fplayer)); } - if (Conf.logFactionLeave) + if (ConfServer.logFactionLeave) Factions.get().log(this.getName()+" left the faction: "+myFaction.getTag()); } @@ -530,7 +530,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator } myFaction.detach(); - if (Conf.logFactionDisband) + if (ConfServer.logFactionDisband) Factions.get().log("The faction "+myFaction.getTag()+" ("+myFaction.getId()+") was disbanded due to the last player ("+this.getName()+") leaving."); } } @@ -543,12 +543,12 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator Faction currentFaction = Board.getFactionAt(flocation); int ownedLand = forFaction.getLandRounded(); - if (Conf.worldGuardChecking && Worldguard.checkForRegionsInChunk(location)) + if (ConfServer.worldGuardChecking && Worldguard.checkForRegionsInChunk(location)) { // Checks for WorldGuard regions in the chunk attempting to be claimed error = Factions.get().txt.parse("This land is protected"); } - else if (Conf.worldsNoClaiming.contains(flocation.getWorldName())) + else if (ConfServer.worldsNoClaiming.contains(flocation.getWorldName())) { error = Factions.get().txt.parse("Sorry, this world has land claiming disabled."); } @@ -564,19 +564,19 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator { return false; } - else if (forFaction.getFPlayers().size() < Conf.claimsRequireMinFactionMembers) + else if (forFaction.getFPlayers().size() < ConfServer.claimsRequireMinFactionMembers) { - error = Factions.get().txt.parse("Factions must have at least %s members to claim land.", Conf.claimsRequireMinFactionMembers); + error = Factions.get().txt.parse("Factions must have at least %s members to claim land.", ConfServer.claimsRequireMinFactionMembers); } else if (ownedLand >= forFaction.getPowerRounded()) { error = Factions.get().txt.parse("You can't claim more land! You need more power!"); } - else if (Conf.claimedLandsMax != 0 && ownedLand >= Conf.claimedLandsMax && ! forFaction.getFlag(FFlag.INFPOWER)) + else if (ConfServer.claimedLandsMax != 0 && ownedLand >= ConfServer.claimedLandsMax && ! forFaction.getFlag(FFlag.INFPOWER)) { error = Factions.get().txt.parse("Limit reached. You can't claim more land!"); } - else if ( ! Conf.claimingFromOthersAllowed && currentFaction.isNormal()) + else if ( ! ConfServer.claimingFromOthersAllowed && currentFaction.isNormal()) { error = Factions.get().txt.parse("You may not claim land from others."); } @@ -586,14 +586,14 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator } else if ( - Conf.claimsMustBeConnected + ConfServer.claimsMustBeConnected && ! this.hasAdminMode() && myFaction.getLandRoundedInWorld(flocation.getWorldName()) > 0 && !Board.isConnectedLocation(flocation, myFaction) - && (!Conf.claimsCanBeUnconnectedIfOwnedByOtherFaction || !currentFaction.isNormal()) + && (!ConfServer.claimsCanBeUnconnectedIfOwnedByOtherFaction || !currentFaction.isNormal()) ) { - if (Conf.claimsCanBeUnconnectedIfOwnedByOtherFaction) + if (ConfServer.claimsCanBeUnconnectedIfOwnedByOtherFaction) error = Factions.get().txt.parse("You can only claim additional land which is connected to your first claim or controlled by another faction!"); else error = Factions.get().txt.parse("You can only claim additional land which is connected to your first claim!"); @@ -639,10 +639,10 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator { cost = Econ.calculateClaimCost(ownedLand, currentFaction.isNormal()); - if (Conf.econClaimUnconnectedFee != 0.0 && forFaction.getLandRoundedInWorld(flocation.getWorldName()) > 0 && !Board.isConnectedLocation(flocation, forFaction)) - cost += Conf.econClaimUnconnectedFee; + if (ConfServer.econClaimUnconnectedFee != 0.0 && forFaction.getLandRoundedInWorld(flocation.getWorldName()) > 0 && !Board.isConnectedLocation(flocation, forFaction)) + cost += ConfServer.econClaimUnconnectedFee; - if(Conf.bankEnabled && Conf.bankFactionPaysLandCosts && this.hasFaction()) + if(ConfServer.bankEnabled && ConfServer.bankFactionPaysLandCosts && this.hasFaction()) payee = this.getFaction(); else payee = this; @@ -657,7 +657,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator // then make 'em pay (if applicable) if (mustPay && ! Econ.modifyMoney(payee, -cost, "to claim this land", "for claiming this land")) return false; - if (LWCFeatures.getEnabled() && forFaction.isNormal() && Conf.onCaptureResetLwcLocks) + if (LWCFeatures.getEnabled() && forFaction.isNormal() && ConfServer.onCaptureResetLwcLocks) LWCFeatures.clearOtherChests(flocation, this.getFaction()); // announce success @@ -672,7 +672,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator Board.setFactionAt(forFaction, flocation); SpoutFeatures.updateTerritoryDisplayLoc(flocation); - if (Conf.logLandClaims) + if (ConfServer.logLandClaims) Factions.get().log(this.getName()+" claimed land at ("+flocation.getCoordString()+") for the faction: "+forFaction.getTag()); return true; @@ -686,7 +686,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator public boolean shouldBeSaved() { if (this.hasFaction()) return true; - if (this.getPowerRounded() != this.getPowerMaxRounded() && this.getPowerRounded() != (int) Math.round(Conf.powerPlayerStarting)) return true; + if (this.getPowerRounded() != this.getPowerMaxRounded() && this.getPowerRounded() != (int) Math.round(ConfServer.powerPlayerStarting)) return true; return false; } diff --git a/src/com/massivecraft/factions/FPlayers.java b/src/com/massivecraft/factions/FPlayers.java index eee27c96..558ec9ff 100644 --- a/src/com/massivecraft/factions/FPlayers.java +++ b/src/com/massivecraft/factions/FPlayers.java @@ -50,19 +50,19 @@ public class FPlayers extends PlayerEntityCollection public void autoLeaveOnInactivityRoutine() { - if (Conf.autoLeaveAfterDaysOfInactivity <= 0.0) + if (ConfServer.autoLeaveAfterDaysOfInactivity <= 0.0) { return; } long now = System.currentTimeMillis(); - double toleranceMillis = Conf.autoLeaveAfterDaysOfInactivity * 24 * 60 * 60 * 1000; + double toleranceMillis = ConfServer.autoLeaveAfterDaysOfInactivity * 24 * 60 * 60 * 1000; for (FPlayer fplayer : FPlayers.i.get()) { if (fplayer.isOffline() && now - fplayer.getLastLoginTime() > toleranceMillis) { - if (Conf.logFactionLeave || Conf.logFactionKick) + if (ConfServer.logFactionLeave || ConfServer.logFactionKick) Factions.get().log("Player "+fplayer.getName()+" was auto-removed due to inactivity."); // if player is faction leader, sort out the faction since he's going away diff --git a/src/com/massivecraft/factions/Faction.java b/src/com/massivecraft/factions/Faction.java index 27e23667..f4608451 100644 --- a/src/com/massivecraft/factions/Faction.java +++ b/src/com/massivecraft/factions/Faction.java @@ -52,7 +52,7 @@ public class Faction extends Entity implements EconomyParticipator } public void setTag(String str) { - if (Conf.factionTagForceUpperCase) + if (ConfServer.factionTagForceUpperCase) { str = str.toUpperCase(); } @@ -76,7 +76,7 @@ public class Faction extends Entity implements EconomyParticipator } public void confirmValidHome() { - if (!Conf.homesMustBeInClaimedTerritory || this.home == null || (this.home.getLocation() != null && Board.getFactionAt(new FLocation(this.home.getLocation())) == this)) + if (!ConfServer.homesMustBeInClaimedTerritory || this.home == null || (this.home.getLocation() != null && Board.getFactionAt(new FLocation(this.home.getLocation())) == this)) return; msg("Your faction home has been un-set since it is no longer in your territory."); @@ -119,7 +119,7 @@ public class Faction extends Entity implements EconomyParticipator } public void setFlag(FFlag flag, boolean value) { - if (Conf.factionFlagDefaults.get(flag).equals(value)) + if (ConfServer.factionFlagDefaults.get(flag).equals(value)) { this.flagOverrides.remove(flag); return; @@ -194,7 +194,7 @@ public class Faction extends Entity implements EconomyParticipator { this.relationWish = new HashMap(); this.invites = new HashSet(); - this.open = Conf.newFactionsDefaultOpen; + this.open = ConfServer.newFactionsDefaultOpen; this.tag = "???"; this.description = "Default faction description :("; this.money = 0.0; @@ -314,9 +314,9 @@ public class Faction extends Entity implements EconomyParticipator { ret += fplayer.getPower(); } - if (Conf.powerFactionMax > 0 && ret > Conf.powerFactionMax) + if (ConfServer.powerFactionMax > 0 && ret > ConfServer.powerFactionMax) { - ret = Conf.powerFactionMax; + ret = ConfServer.powerFactionMax; } return ret + this.powerBoost; } @@ -333,9 +333,9 @@ public class Faction extends Entity implements EconomyParticipator { ret += fplayer.getPowerMax(); } - if (Conf.powerFactionMax > 0 && ret > Conf.powerFactionMax) + if (ConfServer.powerFactionMax > 0 && ret > ConfServer.powerFactionMax) { - ret = Conf.powerFactionMax; + ret = ConfServer.powerFactionMax; } return ret + this.powerBoost; } @@ -468,7 +468,7 @@ public class Faction extends Entity implements EconomyParticipator public void promoteNewLeader() { if (! this.isNormal()) return; - if (this.getFlag(FFlag.PERMANENT) && Conf.permanentFactionsDisableLeaderPromotion) return; + if (this.getFlag(FFlag.PERMANENT) && ConfServer.permanentFactionsDisableLeaderPromotion) return; FPlayer oldLeader = this.getFPlayerLeader(); @@ -487,7 +487,7 @@ public class Faction extends Entity implements EconomyParticipator } // no members left and faction isn't permanent, so disband it - if (Conf.logFactionDisband) + if (ConfServer.logFactionDisband) Factions.get().log("The faction "+this.getTag()+" ("+this.getId()+") has been disbanded since it has no members left."); for (FPlayer fplayer : FPlayers.i.getOnline()) diff --git a/src/com/massivecraft/factions/FactionColl.java b/src/com/massivecraft/factions/FactionColl.java index bf4973ab..c32d4e8d 100644 --- a/src/com/massivecraft/factions/FactionColl.java +++ b/src/com/massivecraft/factions/FactionColl.java @@ -207,14 +207,14 @@ public class FactionColl extends EntityCollection { ArrayList errors = new ArrayList(); - if(MiscUtil.getComparisonString(str).length() < Conf.factionTagLengthMin) + if(MiscUtil.getComparisonString(str).length() < ConfServer.factionTagLengthMin) { - errors.add(Factions.get().txt.parse("The faction tag can't be shorter than %s chars.", Conf.factionTagLengthMin)); + errors.add(Factions.get().txt.parse("The faction tag can't be shorter than %s chars.", ConfServer.factionTagLengthMin)); } - if(str.length() > Conf.factionTagLengthMax) + if(str.length() > ConfServer.factionTagLengthMax) { - errors.add(Factions.get().txt.parse("The faction tag can't be longer than %s chars.", Conf.factionTagLengthMax)); + errors.add(Factions.get().txt.parse("The faction tag can't be longer than %s chars.", ConfServer.factionTagLengthMax)); } for (char c : str.toCharArray()) @@ -273,7 +273,7 @@ public class FactionColl extends EntityCollection { Set players = faction.getFPlayers(); int playerCount = players.size(); - double reward = Conf.econLandReward * landCount / playerCount; + double reward = ConfServer.econLandReward * landCount / playerCount; for (FPlayer player : players) { Econ.modifyMoney(player, reward, "to own faction land", "for faction owning " + landCount + " land divided among " + playerCount + " member(s)"); diff --git a/src/com/massivecraft/factions/Factions.java b/src/com/massivecraft/factions/Factions.java index 56bc207e..20ee6986 100644 --- a/src/com/massivecraft/factions/Factions.java +++ b/src/com/massivecraft/factions/Factions.java @@ -101,7 +101,7 @@ public class Factions extends MPlugin this.loadSuccessful = false; // Load Conf from disk - Conf.load(); + ConfServer.load(); FPlayers.i.loadFromDisc(); FactionColl.i.loadFromDisc(); Board.load(); @@ -116,7 +116,7 @@ public class Factions extends MPlugin HerochatFeatures.setup(); LWCFeatures.setup(); - if(Conf.worldGuardChecking) + if(ConfServer.worldGuardChecking) { Worldguard.init(this); } @@ -174,7 +174,7 @@ public class Factions extends MPlugin if (this.loadSuccessful) { Board.save(); - Conf.save(); + ConfServer.save(); } EssentialsFeatures.unhookChat(); if (AutoLeaveTask != null) @@ -196,9 +196,9 @@ public class Factions extends MPlugin this.getServer().getScheduler().cancelTask(AutoLeaveTask); } - if (Conf.autoLeaveRoutineRunsEveryXMinutes > 0.0) + if (ConfServer.autoLeaveRoutineRunsEveryXMinutes > 0.0) { - long ticks = (long)(20 * 60 * Conf.autoLeaveRoutineRunsEveryXMinutes); + long ticks = (long)(20 * 60 * ConfServer.autoLeaveRoutineRunsEveryXMinutes); AutoLeaveTask = getServer().getScheduler().scheduleSyncRepeatingTask(this, new AutoLeaveTask(), ticks, ticks); } } @@ -211,11 +211,11 @@ public class Factions extends MPlugin this.getServer().getScheduler().cancelTask(econLandRewardTaskID); } - if (Conf.econEnabled && - Conf.econLandRewardTaskRunsEveryXMinutes > 0.0 && - Conf.econLandReward > 0.0) + if (ConfServer.econEnabled && + ConfServer.econLandRewardTaskRunsEveryXMinutes > 0.0 && + ConfServer.econLandReward > 0.0) { - long ticks = (long)(20 * 60 * Conf.econLandRewardTaskRunsEveryXMinutes); + long ticks = (long)(20 * 60 * ConfServer.econLandRewardTaskRunsEveryXMinutes); econLandRewardTaskID = getServer().getScheduler().scheduleSyncRepeatingTask(this, new EconLandRewardTask(), ticks, ticks); } } @@ -224,7 +224,7 @@ public class Factions extends MPlugin public void postAutoSave() { Board.save(); - Conf.save(); + ConfServer.save(); } @Override @@ -247,7 +247,7 @@ public class Factions extends MPlugin // If another plugin is handling insertion of chat tags, this should be used to notify Factions public void handleFactionTagExternally(boolean notByFactions) { - Conf.chatTagHandledByAnotherPlugin = notByFactions; + ConfServer.chatTagHandledByAnotherPlugin = notByFactions; } // Get a player's faction tag (faction name), mainly for usage by chat plugins for local/channel chat @@ -269,7 +269,7 @@ public class Factions extends MPlugin return tag; // if listener isn't set, or config option is disabled, give back uncolored tag - if (listener == null || !Conf.chatParseTagsColored) { + if (listener == null || !ConfServer.chatParseTagsColored) { tag = me.getChatTag().trim(); } else { FPlayer you = FPlayers.i.get(listener); diff --git a/src/com/massivecraft/factions/cmd/CmdClaim.java b/src/com/massivecraft/factions/cmd/CmdClaim.java index dde22447..c191b46c 100644 --- a/src/com/massivecraft/factions/cmd/CmdClaim.java +++ b/src/com/massivecraft/factions/cmd/CmdClaim.java @@ -1,6 +1,6 @@ package com.massivecraft.factions.cmd; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FLocation; import com.massivecraft.factions.Faction; import com.massivecraft.factions.Perm; @@ -58,7 +58,7 @@ public class CmdClaim extends FCommand new SpiralTask(new FLocation(me), radius) { private int failCount = 0; - private final int limit = Conf.radiusClaimFailureLimit - 1; + private final int limit = ConfServer.radiusClaimFailureLimit - 1; @Override public boolean work() diff --git a/src/com/massivecraft/factions/cmd/CmdConfig.java b/src/com/massivecraft/factions/cmd/CmdConfig.java index 15090e7a..1c9e8b71 100644 --- a/src/com/massivecraft/factions/cmd/CmdConfig.java +++ b/src/com/massivecraft/factions/cmd/CmdConfig.java @@ -12,7 +12,7 @@ import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Player; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; import com.massivecraft.factions.integration.SpoutFeatures; @@ -49,7 +49,7 @@ public class CmdConfig extends FCommand // that way, if the person using this command messes up the capitalization, we can fix that if (properFieldNames.isEmpty()) { - Field[] fields = Conf.class.getDeclaredFields(); + Field[] fields = ConfServer.class.getDeclaredFields(); for(int i = 0; i < fields.length; i++) { properFieldNames.put(fields[i].getName().toLowerCase(), fields[i].getName()); @@ -79,7 +79,7 @@ public class CmdConfig extends FCommand try { - Field target = Conf.class.getField(fieldName); + Field target = ConfServer.class.getField(fieldName); // boolean if (target.getType() == boolean.class) @@ -390,7 +390,7 @@ public class CmdConfig extends FCommand } } // save change to disk - Conf.save(); + ConfServer.save(); // in case some Spout related setting was changed SpoutFeatures.updateTitle(null, null); diff --git a/src/com/massivecraft/factions/cmd/CmdCreate.java b/src/com/massivecraft/factions/cmd/CmdCreate.java index f08c3a71..755180e4 100644 --- a/src/com/massivecraft/factions/cmd/CmdCreate.java +++ b/src/com/massivecraft/factions/cmd/CmdCreate.java @@ -4,7 +4,7 @@ import java.util.ArrayList; import org.bukkit.Bukkit; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayers; import com.massivecraft.factions.Faction; @@ -59,7 +59,7 @@ public class CmdCreate extends FCommand } // if economy is enabled, they're not on the bypass list, and this command has a cost set, make sure they can pay - if ( ! canAffordCommand(Conf.econCostCreate, "to create a new faction")) return; + if ( ! canAffordCommand(ConfServer.econCostCreate, "to create a new faction")) return; // trigger the faction creation event (cancellable) FactionCreateEvent createEvent = new FactionCreateEvent(me, tag); @@ -67,7 +67,7 @@ public class CmdCreate extends FCommand if(createEvent.isCancelled()) return; // then make 'em pay (if applicable) - if ( ! payForCommand(Conf.econCostCreate, "to create a new faction", "for creating a new faction")) return; + if ( ! payForCommand(ConfServer.econCostCreate, "to create a new faction", "for creating a new faction")) return; Faction faction = FactionColl.i.create(); @@ -97,7 +97,7 @@ public class CmdCreate extends FCommand msg("You should now: %s", p.cmdBase.cmdDescription.getUseageTemplate()); - if (Conf.logFactionCreate) + if (ConfServer.logFactionCreate) Factions.get().log(fme.getName()+" created a new faction: "+tag); } diff --git a/src/com/massivecraft/factions/cmd/CmdDescription.java b/src/com/massivecraft/factions/cmd/CmdDescription.java index 38431a70..50aa5716 100644 --- a/src/com/massivecraft/factions/cmd/CmdDescription.java +++ b/src/com/massivecraft/factions/cmd/CmdDescription.java @@ -1,6 +1,6 @@ package com.massivecraft.factions.cmd; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayers; import com.massivecraft.factions.Perm; @@ -30,11 +30,11 @@ public class CmdDescription extends FCommand public void perform() { // if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay - if ( ! payForCommand(Conf.econCostDesc, "to change faction description", "for changing faction description")) return; + if ( ! payForCommand(ConfServer.econCostDesc, "to change faction description", "for changing faction description")) return; myFaction.setDescription(TextUtil.implode(args, " ").replaceAll("(&([a-f0-9]))", "& $2")); // since "&" color tags seem to work even through plain old FPlayer.sendMessage() for some reason, we need to break those up - if ( ! Conf.broadcastDescriptionChanges) + if ( ! ConfServer.broadcastDescriptionChanges) { fme.msg("You have changed the description for %s to:", myFaction.describeTo(fme)); fme.sendMessage(myFaction.getDescription()); diff --git a/src/com/massivecraft/factions/cmd/CmdDisband.java b/src/com/massivecraft/factions/cmd/CmdDisband.java index bebd6d89..ed9d6502 100644 --- a/src/com/massivecraft/factions/cmd/CmdDisband.java +++ b/src/com/massivecraft/factions/cmd/CmdDisband.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd; import org.bukkit.Bukkit; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.event.FPlayerLeaveEvent; import com.massivecraft.factions.event.FactionDisbandEvent; import com.massivecraft.factions.integration.Econ; @@ -72,7 +72,7 @@ public class CmdDisband extends FCommand fplayer.msg("%s disbanded the faction %s.", who, faction.getTag(fplayer)); } } - if (Conf.logFactionDisband) + if (ConfServer.logFactionDisband) Factions.get().log("The faction "+faction.getTag()+" ("+faction.getId()+") was disbanded by "+(senderIsConsole ? "console command" : fme.getName())+"."); if (Econ.shouldBeUsed() && ! senderIsConsole) diff --git a/src/com/massivecraft/factions/cmd/CmdHelp.java b/src/com/massivecraft/factions/cmd/CmdHelp.java index ba8d7227..0f4d16a3 100644 --- a/src/com/massivecraft/factions/cmd/CmdHelp.java +++ b/src/com/massivecraft/factions/cmd/CmdHelp.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd; import java.util.ArrayList; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; import com.massivecraft.factions.integration.Econ; @@ -83,7 +83,7 @@ public class CmdHelp extends FCommand pageLines.add( p.cmdBase.cmdSethome.getUseageTemplate(true) ); helpPages.add(pageLines); - if (Econ.isSetup() && Conf.econEnabled && Conf.bankEnabled) + if (Econ.isSetup() && ConfServer.econEnabled && ConfServer.bankEnabled) { pageLines = new ArrayList(); pageLines.add( p.txt.parse("Your faction has a bank which is used to pay for certain" )); diff --git a/src/com/massivecraft/factions/cmd/CmdHome.java b/src/com/massivecraft/factions/cmd/CmdHome.java index 59e88ba1..b0758191 100644 --- a/src/com/massivecraft/factions/cmd/CmdHome.java +++ b/src/com/massivecraft/factions/cmd/CmdHome.java @@ -8,7 +8,7 @@ import org.bukkit.World; import org.bukkit.entity.Player; import com.massivecraft.factions.Board; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FLocation; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayers; @@ -44,13 +44,13 @@ public class CmdHome extends FCommand public void perform() { // TODO: Hide this command on help also. - if ( ! Conf.homesEnabled) + if ( ! ConfServer.homesEnabled) { fme.msg("Sorry, Faction homes are disabled on this server."); return; } - if ( ! Conf.homesTeleportCommandEnabled) + if ( ! ConfServer.homesTeleportCommandEnabled) { fme.msg("Sorry, the ability to teleport to Faction homes is disabled on this server."); return; @@ -63,13 +63,13 @@ public class CmdHome extends FCommand return; } - if ( ! Conf.homesTeleportAllowedFromEnemyTerritory && fme.isInEnemyTerritory()) + if ( ! ConfServer.homesTeleportAllowedFromEnemyTerritory && fme.isInEnemyTerritory()) { fme.msg("You cannot teleport to your faction home while in the territory of an enemy faction."); return; } - if ( ! Conf.homesTeleportAllowedFromDifferentWorld && me.getWorld().getUID() != myFaction.getHome().getWorld().getUID()) + if ( ! ConfServer.homesTeleportAllowedFromDifferentWorld && me.getWorld().getUID() != myFaction.getHome().getWorld().getUID()) { fme.msg("You cannot teleport to your faction home while in a different world."); return; @@ -81,7 +81,7 @@ public class CmdHome extends FCommand // if player is not in a safe zone or their own faction territory, only allow teleport if no enemies are nearby if ( - Conf.homesTeleportAllowedEnemyDistance > 0 + ConfServer.homesTeleportAllowedEnemyDistance > 0 && faction.getFlag(FFlag.PVP) && @@ -91,7 +91,7 @@ public class CmdHome extends FCommand ( fme.isInOwnTerritory() && - ! Conf.homesTeleportIgnoreEnemiesIfInOwnTerritory + ! ConfServer.homesTeleportIgnoreEnemiesIfInOwnTerritory ) ) ) @@ -114,13 +114,13 @@ public class CmdHome extends FCommand double dx = Math.abs(x - l.getX()); double dy = Math.abs(y - l.getY()); double dz = Math.abs(z - l.getZ()); - double max = Conf.homesTeleportAllowedEnemyDistance; + double max = ConfServer.homesTeleportAllowedEnemyDistance; // box-shaped distance check if (dx > max || dy > max || dz > max) continue; - fme.msg("You cannot teleport to your faction home while an enemy is within " + Conf.homesTeleportAllowedEnemyDistance + " blocks of you."); + fme.msg("You cannot teleport to your faction home while an enemy is within " + ConfServer.homesTeleportAllowedEnemyDistance + " blocks of you."); return; } } @@ -129,10 +129,10 @@ public class CmdHome extends FCommand if (EssentialsFeatures.handleTeleport(me, myFaction.getHome())) return; // if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay - if ( ! payForCommand(Conf.econCostHome, "to teleport to your faction home", "for teleporting to your faction home")) return; + if ( ! payForCommand(ConfServer.econCostHome, "to teleport to your faction home", "for teleporting to your faction home")) return; // Create a smoke effect - if (Conf.homesTeleportCommandSmokeEffectEnabled) + if (ConfServer.homesTeleportCommandSmokeEffectEnabled) { List smokeLocations = new ArrayList(); smokeLocations.add(loc); diff --git a/src/com/massivecraft/factions/cmd/CmdInvite.java b/src/com/massivecraft/factions/cmd/CmdInvite.java index b7f8d873..7c9aa01e 100644 --- a/src/com/massivecraft/factions/cmd/CmdInvite.java +++ b/src/com/massivecraft/factions/cmd/CmdInvite.java @@ -1,6 +1,6 @@ package com.massivecraft.factions.cmd; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.Perm; import com.massivecraft.factions.struct.FPerm; @@ -41,7 +41,7 @@ public class CmdInvite extends FCommand if (fme != null && ! FPerm.INVITE.has(fme, myFaction)) return; // if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay - if ( ! payForCommand(Conf.econCostInvite, "to invite someone", "for inviting someone")) return; + if ( ! payForCommand(ConfServer.econCostInvite, "to invite someone", "for inviting someone")) return; myFaction.invite(you); diff --git a/src/com/massivecraft/factions/cmd/CmdJoin.java b/src/com/massivecraft/factions/cmd/CmdJoin.java index 72d8c4f7..34783658 100644 --- a/src/com/massivecraft/factions/cmd/CmdJoin.java +++ b/src/com/massivecraft/factions/cmd/CmdJoin.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd; import org.bukkit.Bukkit; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayers; import com.massivecraft.factions.Faction; @@ -50,9 +50,9 @@ public class CmdJoin extends FCommand return; } - if (Conf.factionMemberLimit > 0 && faction.getFPlayers().size() >= Conf.factionMemberLimit) + if (ConfServer.factionMemberLimit > 0 && faction.getFPlayers().size() >= ConfServer.factionMemberLimit) { - msg(" ! The faction %s is at the limit of %d members, so %s cannot currently join.", faction.getTag(fme), Conf.factionMemberLimit, fplayer.describeTo(fme, false)); + msg(" ! The faction %s is at the limit of %d members, so %s cannot currently join.", faction.getTag(fme), ConfServer.factionMemberLimit, fplayer.describeTo(fme, false)); return; } @@ -62,7 +62,7 @@ public class CmdJoin extends FCommand return; } - if (!Conf.canLeaveWithNegativePower && fplayer.getPower() < 0) + if (!ConfServer.canLeaveWithNegativePower && fplayer.getPower() < 0) { msg("%s cannot join a faction with a negative power level.", fplayer.describeTo(fme, true)); return; @@ -77,7 +77,7 @@ public class CmdJoin extends FCommand } // if economy is enabled, they're not on the bypass list, and this command has a cost set, make sure they can pay - if (samePlayer && ! canAffordCommand(Conf.econCostJoin, "to join a faction")) return; + if (samePlayer && ! canAffordCommand(ConfServer.econCostJoin, "to join a faction")) return; // trigger the join event (cancellable) FPlayerJoinEvent joinEvent = new FPlayerJoinEvent(FPlayers.i.get(me),faction,FPlayerJoinEvent.PlayerJoinReason.COMMAND); @@ -85,9 +85,9 @@ public class CmdJoin extends FCommand if (joinEvent.isCancelled()) return; // then make 'em pay (if applicable) - if (samePlayer && ! payForCommand(Conf.econCostJoin, "to join a faction", "for joining a faction")) return; + if (samePlayer && ! payForCommand(ConfServer.econCostJoin, "to join a faction", "for joining a faction")) return; - fme.setRole(Conf.factionRankDefault); // They have just joined a faction, start them out on the lowest rank (default config). + fme.setRole(ConfServer.factionRankDefault); // They have just joined a faction, start them out on the lowest rank (default config). if (!samePlayer) fplayer.msg("%s moved you into the faction %s.", fme.describeTo(fplayer, true), faction.getTag(fplayer)); @@ -100,7 +100,7 @@ public class CmdJoin extends FCommand faction.deinvite(fplayer); - if (Conf.logFactionJoin) + if (ConfServer.logFactionJoin) { if (samePlayer) Factions.get().log("%s joined the faction %s.", fplayer.getName(), faction.getTag()); diff --git a/src/com/massivecraft/factions/cmd/CmdKick.java b/src/com/massivecraft/factions/cmd/CmdKick.java index 38ac0eda..94dd1b43 100644 --- a/src/com/massivecraft/factions/cmd/CmdKick.java +++ b/src/com/massivecraft/factions/cmd/CmdKick.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd; import org.bukkit.Bukkit; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.Faction; import com.massivecraft.factions.Factions; @@ -50,7 +50,7 @@ public class CmdKick extends FCommand return; } - if ( ! Conf.canLeaveWithNegativePower && you.getPower() < 0) + if ( ! ConfServer.canLeaveWithNegativePower && you.getPower() < 0) { msg("You cannot kick that member until their power is positive."); return; @@ -61,7 +61,7 @@ public class CmdKick extends FCommand if (fme != null && ! FPerm.KICK.has(fme, yourFaction)) return; // if economy is enabled, they're not on the bypass list, and this command has a cost set, make sure they can pay - if ( ! canAffordCommand(Conf.econCostKick, "to kick someone from the faction")) return; + if ( ! canAffordCommand(ConfServer.econCostKick, "to kick someone from the faction")) return; // trigger the leave event (cancellable) [reason:kicked] FPlayerLeaveEvent event = new FPlayerLeaveEvent(you, you.getFaction(), FPlayerLeaveEvent.PlayerLeaveReason.KICKED); @@ -69,7 +69,7 @@ public class CmdKick extends FCommand if (event.isCancelled()) return; // then make 'em pay (if applicable) - if ( ! payForCommand(Conf.econCostKick, "to kick someone from the faction", "for kicking someone from the faction")) return; + if ( ! payForCommand(ConfServer.econCostKick, "to kick someone from the faction", "for kicking someone from the faction")) return; yourFaction.msg("%s kicked %s from the faction! :O", fme.describeTo(yourFaction, true), you.describeTo(yourFaction, true)); you.msg("%s kicked you from %s! :O", fme.describeTo(you, true), yourFaction.describeTo(you)); @@ -78,7 +78,7 @@ public class CmdKick extends FCommand fme.msg("You kicked %s from the faction %s!", you.describeTo(fme), yourFaction.describeTo(fme)); } - if (Conf.logFactionKick) + if (ConfServer.logFactionKick) Factions.get().log((senderIsConsole ? "A console command" : fme.getName())+" kicked "+you.getName()+" from the faction: "+yourFaction.getTag()); if (you.getRole() == Rel.LEADER) diff --git a/src/com/massivecraft/factions/cmd/CmdList.java b/src/com/massivecraft/factions/cmd/CmdList.java index f0ecc8e2..d12a2cda 100644 --- a/src/com/massivecraft/factions/cmd/CmdList.java +++ b/src/com/massivecraft/factions/cmd/CmdList.java @@ -4,7 +4,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.Faction; import com.massivecraft.factions.FactionColl; import com.massivecraft.factions.Perm; @@ -35,7 +35,7 @@ public class CmdList extends FCommand public void perform() { // if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay - if ( ! payForCommand(Conf.econCostList, "to list the factions", "for listing the factions")) return; + if ( ! payForCommand(ConfServer.econCostList, "to list the factions", "for listing the factions")) return; ArrayList factionList = new ArrayList(FactionColl.i.get()); diff --git a/src/com/massivecraft/factions/cmd/CmdMap.java b/src/com/massivecraft/factions/cmd/CmdMap.java index 965641c7..698624b9 100644 --- a/src/com/massivecraft/factions/cmd/CmdMap.java +++ b/src/com/massivecraft/factions/cmd/CmdMap.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Board; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FLocation; import com.massivecraft.factions.Perm; @@ -35,7 +35,7 @@ public class CmdMap extends FCommand // Turn on // if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay - if ( ! payForCommand(Conf.econCostMap, "to show the map", "for showing the map")) return; + if ( ! payForCommand(ConfServer.econCostMap, "to show the map", "for showing the map")) return; fme.setMapAutoUpdating(true); msg("Map auto update ENABLED."); @@ -53,7 +53,7 @@ public class CmdMap extends FCommand else { // if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay - if ( ! payForCommand(Conf.econCostMap, "to show the map", "for showing the map")) return; + if ( ! payForCommand(ConfServer.econCostMap, "to show the map", "for showing the map")) return; showMap(); } diff --git a/src/com/massivecraft/factions/cmd/CmdMoneyDeposit.java b/src/com/massivecraft/factions/cmd/CmdMoneyDeposit.java index 0e4d51e0..79066c64 100644 --- a/src/com/massivecraft/factions/cmd/CmdMoneyDeposit.java +++ b/src/com/massivecraft/factions/cmd/CmdMoneyDeposit.java @@ -1,6 +1,6 @@ package com.massivecraft.factions.cmd; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; import com.massivecraft.factions.iface.EconomyParticipator; @@ -38,7 +38,7 @@ public class CmdMoneyDeposit extends FCommand if (faction == null) return; boolean success = Econ.transferMoney(fme, fme, faction, amount); - if (success && Conf.logMoneyTransactions) + if (success && ConfServer.logMoneyTransactions) Factions.get().log(ChatColor.stripColor(Factions.get().txt.parse("%s deposited %s in the faction bank: %s", fme.getName(), Econ.moneyString(amount), faction.describeTo(null)))); } diff --git a/src/com/massivecraft/factions/cmd/CmdMoneyTransferFf.java b/src/com/massivecraft/factions/cmd/CmdMoneyTransferFf.java index 50831a01..2b90051c 100644 --- a/src/com/massivecraft/factions/cmd/CmdMoneyTransferFf.java +++ b/src/com/massivecraft/factions/cmd/CmdMoneyTransferFf.java @@ -1,6 +1,6 @@ package com.massivecraft.factions.cmd; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.Perm; import com.massivecraft.factions.iface.EconomyParticipator; import com.massivecraft.factions.Factions; @@ -41,7 +41,7 @@ public class CmdMoneyTransferFf extends FCommand boolean success = Econ.transferMoney(fme, from, to, amount); - if (success && Conf.logMoneyTransactions) + if (success && ConfServer.logMoneyTransactions) Factions.get().log(ChatColor.stripColor(Factions.get().txt.parse("%s transferred %s from the faction \"%s\" to the faction \"%s\"", fme.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null)))); } } diff --git a/src/com/massivecraft/factions/cmd/CmdMoneyTransferFp.java b/src/com/massivecraft/factions/cmd/CmdMoneyTransferFp.java index 505d56b3..dcdfa558 100644 --- a/src/com/massivecraft/factions/cmd/CmdMoneyTransferFp.java +++ b/src/com/massivecraft/factions/cmd/CmdMoneyTransferFp.java @@ -1,6 +1,6 @@ package com.massivecraft.factions.cmd; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.Perm; import com.massivecraft.factions.iface.EconomyParticipator; import com.massivecraft.factions.Factions; @@ -41,7 +41,7 @@ public class CmdMoneyTransferFp extends FCommand boolean success = Econ.transferMoney(fme, from, to, amount); - if (success && Conf.logMoneyTransactions) + if (success && ConfServer.logMoneyTransactions) Factions.get().log(ChatColor.stripColor(Factions.get().txt.parse("%s transferred %s from the faction \"%s\" to the player \"%s\"", fme.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null)))); } } diff --git a/src/com/massivecraft/factions/cmd/CmdMoneyTransferPf.java b/src/com/massivecraft/factions/cmd/CmdMoneyTransferPf.java index 193de3c0..c42dd773 100644 --- a/src/com/massivecraft/factions/cmd/CmdMoneyTransferPf.java +++ b/src/com/massivecraft/factions/cmd/CmdMoneyTransferPf.java @@ -1,6 +1,6 @@ package com.massivecraft.factions.cmd; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.Perm; import com.massivecraft.factions.iface.EconomyParticipator; import com.massivecraft.factions.Factions; @@ -41,7 +41,7 @@ public class CmdMoneyTransferPf extends FCommand boolean success = Econ.transferMoney(fme, from, to, amount); - if (success && Conf.logMoneyTransactions) + if (success && ConfServer.logMoneyTransactions) Factions.get().log(ChatColor.stripColor(Factions.get().txt.parse("%s transferred %s from the player \"%s\" to the faction \"%s\"", fme.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null)))); } } diff --git a/src/com/massivecraft/factions/cmd/CmdMoneyWithdraw.java b/src/com/massivecraft/factions/cmd/CmdMoneyWithdraw.java index 2e5eff4a..a3725776 100644 --- a/src/com/massivecraft/factions/cmd/CmdMoneyWithdraw.java +++ b/src/com/massivecraft/factions/cmd/CmdMoneyWithdraw.java @@ -1,6 +1,6 @@ package com.massivecraft.factions.cmd; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.Perm; import com.massivecraft.factions.iface.EconomyParticipator; import com.massivecraft.factions.Factions; @@ -36,7 +36,7 @@ public class CmdMoneyWithdraw extends FCommand if (faction == null) return; boolean success = Econ.transferMoney(fme, faction, fme, amount); - if (success && Conf.logMoneyTransactions) + if (success && ConfServer.logMoneyTransactions) Factions.get().log(ChatColor.stripColor(Factions.get().txt.parse("%s withdrew %s from the faction bank: %s", fme.getName(), Econ.moneyString(amount), faction.describeTo(null)))); } } diff --git a/src/com/massivecraft/factions/cmd/CmdOpen.java b/src/com/massivecraft/factions/cmd/CmdOpen.java index 54acfc24..458301b5 100644 --- a/src/com/massivecraft/factions/cmd/CmdOpen.java +++ b/src/com/massivecraft/factions/cmd/CmdOpen.java @@ -1,6 +1,6 @@ package com.massivecraft.factions.cmd; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.Faction; import com.massivecraft.factions.FactionColl; import com.massivecraft.factions.Perm; @@ -28,7 +28,7 @@ public class CmdOpen extends FCommand public void perform() { // if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay - if ( ! payForCommand(Conf.econCostOpen, "to open or close the faction", "for opening or closing the faction")) return; + if ( ! payForCommand(ConfServer.econCostOpen, "to open or close the faction", "for opening or closing the faction")) return; myFaction.setOpen(this.argAsBool(0, ! myFaction.getOpen())); diff --git a/src/com/massivecraft/factions/cmd/CmdPower.java b/src/com/massivecraft/factions/cmd/CmdPower.java index c9b96913..cadfd5fe 100644 --- a/src/com/massivecraft/factions/cmd/CmdPower.java +++ b/src/com/massivecraft/factions/cmd/CmdPower.java @@ -1,6 +1,6 @@ package com.massivecraft.factions.cmd; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.Perm; @@ -34,7 +34,7 @@ public class CmdPower extends FCommand if (target != fme && ! Perm.POWER_ANY.has(sender, true)) return; // if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay - if ( ! payForCommand(Conf.econCostPower, "to show player power info", "for showing player power info")) return; + if ( ! payForCommand(ConfServer.econCostPower, "to show player power info", "for showing player power info")) return; double powerBoost = target.getPowerBoost(); String boost = (powerBoost == 0.0) ? "" : (powerBoost > 0.0 ? " (bonus: " : " (penalty: ") + powerBoost + ")"; diff --git a/src/com/massivecraft/factions/cmd/CmdReload.java b/src/com/massivecraft/factions/cmd/CmdReload.java index 8ce46a77..7f9db746 100644 --- a/src/com/massivecraft/factions/cmd/CmdReload.java +++ b/src/com/massivecraft/factions/cmd/CmdReload.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Board; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FPlayers; import com.massivecraft.factions.FactionColl; import com.massivecraft.factions.Factions; @@ -37,7 +37,7 @@ public class CmdReload extends FCommand if (file.startsWith("c")) { - Conf.load(); + ConfServer.load(); fileName = "conf.json"; } else if (file.startsWith("b")) @@ -58,7 +58,7 @@ public class CmdReload extends FCommand else if (file.startsWith("a")) { fileName = "all"; - Conf.load(); + ConfServer.load(); FPlayers.i.loadFromDisc(); FactionColl.i.loadFromDisc(); Board.load(); diff --git a/src/com/massivecraft/factions/cmd/CmdSaveAll.java b/src/com/massivecraft/factions/cmd/CmdSaveAll.java index 720ef594..d1a29375 100644 --- a/src/com/massivecraft/factions/cmd/CmdSaveAll.java +++ b/src/com/massivecraft/factions/cmd/CmdSaveAll.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Board; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FPlayers; import com.massivecraft.factions.FactionColl; import com.massivecraft.factions.Perm; @@ -33,7 +33,7 @@ public class CmdSaveAll extends FCommand FPlayers.i.saveToDisc(); FactionColl.i.saveToDisc(); Board.save(); - Conf.save(); + ConfServer.save(); msg("Factions saved to disk!"); } diff --git a/src/com/massivecraft/factions/cmd/CmdSethome.java b/src/com/massivecraft/factions/cmd/CmdSethome.java index 923456b9..330545cf 100644 --- a/src/com/massivecraft/factions/cmd/CmdSethome.java +++ b/src/com/massivecraft/factions/cmd/CmdSethome.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Board; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FLocation; import com.massivecraft.factions.Faction; import com.massivecraft.factions.Perm; @@ -28,7 +28,7 @@ public class CmdSethome extends FCommand @Override public void perform() { - if ( ! Conf.homesEnabled) + if ( ! ConfServer.homesEnabled) { fme.msg("Sorry, Faction homes are disabled on this server."); return; @@ -45,7 +45,7 @@ public class CmdSethome extends FCommand ( ! fme.hasAdminMode() && - Conf.homesMustBeInClaimedTerritory + ConfServer.homesMustBeInClaimedTerritory && Board.getFactionAt(new FLocation(me)) != faction ) @@ -55,7 +55,7 @@ public class CmdSethome extends FCommand } // if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay - if ( ! payForCommand(Conf.econCostSethome, "to set the faction home", "for setting the faction home")) return; + if ( ! payForCommand(ConfServer.econCostSethome, "to set the faction home", "for setting the faction home")) return; faction.setHome(me.getLocation()); diff --git a/src/com/massivecraft/factions/cmd/CmdShow.java b/src/com/massivecraft/factions/cmd/CmdShow.java index f2631a02..9ebd0d21 100644 --- a/src/com/massivecraft/factions/cmd/CmdShow.java +++ b/src/com/massivecraft/factions/cmd/CmdShow.java @@ -5,7 +5,7 @@ import java.util.Collection; import java.util.List; import java.util.Map; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.Faction; @@ -44,7 +44,7 @@ public class CmdShow extends FCommand } // if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay - if ( ! payForCommand(Conf.econCostShow, "to show faction information", "for showing faction information")) return; + if ( ! payForCommand(ConfServer.econCostShow, "to show faction information", "for showing faction information")) return; Collection admins = faction.getFPlayersWhereRole(Rel.LEADER); Collection mods = faction.getFPlayersWhereRole(Rel.OFFICER); @@ -76,7 +76,7 @@ public class CmdShow extends FCommand if (Econ.shouldBeUsed()) { double value = Econ.calculateTotalLandValue(faction.getLandRounded()); - double refund = value * Conf.econClaimRefundMultiplier; + double refund = value * ConfServer.econClaimRefundMultiplier; if (value > 0) { String stringValue = Econ.moneyString(value); @@ -85,7 +85,7 @@ public class CmdShow extends FCommand } //Show bank contents - if(Conf.bankEnabled) + if(ConfServer.bankEnabled) { msg("Bank contains: "+Econ.moneyString(Econ.getBalance(faction.getAccountId()))); } diff --git a/src/com/massivecraft/factions/cmd/CmdTag.java b/src/com/massivecraft/factions/cmd/CmdTag.java index 4c915636..ba453c3b 100644 --- a/src/com/massivecraft/factions/cmd/CmdTag.java +++ b/src/com/massivecraft/factions/cmd/CmdTag.java @@ -4,7 +4,7 @@ import java.util.ArrayList; import org.bukkit.Bukkit; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.Faction; import com.massivecraft.factions.FactionColl; import com.massivecraft.factions.Perm; @@ -52,7 +52,7 @@ public class CmdTag extends FCommand } // if economy is enabled, they're not on the bypass list, and this command has a cost set, make sure they can pay - if ( ! canAffordCommand(Conf.econCostTag, "to change the faction tag")) return; + if ( ! canAffordCommand(ConfServer.econCostTag, "to change the faction tag")) return; // trigger the faction rename event (cancellable) FactionRenameEvent renameEvent = new FactionRenameEvent(fme, tag); @@ -60,7 +60,7 @@ public class CmdTag extends FCommand if(renameEvent.isCancelled()) return; // then make 'em pay (if applicable) - if ( ! payForCommand(Conf.econCostTag, "to change the faction tag", "for changing the faction tag")) return; + if ( ! payForCommand(ConfServer.econCostTag, "to change the faction tag", "for changing the faction tag")) return; String oldtag = myFaction.getTag(); myFaction.setTag(tag); @@ -76,7 +76,7 @@ public class CmdTag extends FCommand faction.msg("The faction %s changed their name to %s.", fme.getColorTo(faction)+oldtag, myFaction.getTag(faction)); } - if (Conf.spoutFactionTagsOverNames) + if (ConfServer.spoutFactionTagsOverNames) { SpoutFeatures.updateTitle(myFaction, null); } diff --git a/src/com/massivecraft/factions/cmd/CmdTitle.java b/src/com/massivecraft/factions/cmd/CmdTitle.java index c3962c6d..6061cc8c 100644 --- a/src/com/massivecraft/factions/cmd/CmdTitle.java +++ b/src/com/massivecraft/factions/cmd/CmdTitle.java @@ -1,6 +1,6 @@ package com.massivecraft.factions.cmd; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.Perm; import com.massivecraft.factions.integration.SpoutFeatures; @@ -36,14 +36,14 @@ public class CmdTitle extends FCommand if ( ! canIAdministerYou(fme, you)) return; // if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay - if ( ! payForCommand(Conf.econCostTitle, "to change a players title", "for changing a players title")) return; + if ( ! payForCommand(ConfServer.econCostTitle, "to change a players title", "for changing a players title")) return; you.setTitle(title); // Inform myFaction.msg("%s changed a title: %s", fme.describeTo(myFaction, true), you.describeTo(myFaction, true)); - if (Conf.spoutFactionTitlesOverNames) + if (ConfServer.spoutFactionTitlesOverNames) { SpoutFeatures.updateTitle(me, null); } diff --git a/src/com/massivecraft/factions/cmd/CmdUnclaim.java b/src/com/massivecraft/factions/cmd/CmdUnclaim.java index d290a981..e1a40ec5 100644 --- a/src/com/massivecraft/factions/cmd/CmdUnclaim.java +++ b/src/com/massivecraft/factions/cmd/CmdUnclaim.java @@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd; import org.bukkit.Bukkit; import com.massivecraft.factions.Board; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.event.LandUnclaimEvent; import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.integration.SpoutFeatures; @@ -49,7 +49,7 @@ public class CmdUnclaim extends FCommand { double refund = Econ.calculateClaimRefund(myFaction.getLandRounded()); - if(Conf.bankEnabled && Conf.bankFactionPaysLandCosts) + if(ConfServer.bankEnabled && ConfServer.bankFactionPaysLandCosts) { if ( ! Econ.modifyMoney(myFaction, refund, "to unclaim this land", "for unclaiming this land")) return; } @@ -63,7 +63,7 @@ public class CmdUnclaim extends FCommand SpoutFeatures.updateTerritoryDisplayLoc(flocation); myFaction.msg("%s unclaimed some land.", fme.describeTo(myFaction, true)); - if (Conf.logLandUnclaims) + if (ConfServer.logLandUnclaims) Factions.get().log(fme.getName()+" unclaimed land at ("+flocation.getCoordString()+") from the faction: "+otherFaction.getTag()); } diff --git a/src/com/massivecraft/factions/cmd/CmdUnclaimall.java b/src/com/massivecraft/factions/cmd/CmdUnclaimall.java index a486fcb7..4ada4db0 100644 --- a/src/com/massivecraft/factions/cmd/CmdUnclaimall.java +++ b/src/com/massivecraft/factions/cmd/CmdUnclaimall.java @@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd; import org.bukkit.Bukkit; import com.massivecraft.factions.Board; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; import com.massivecraft.factions.event.LandUnclaimAllEvent; @@ -35,7 +35,7 @@ public class CmdUnclaimall extends FCommand if (Econ.shouldBeUsed()) { double refund = Econ.calculateTotalLandRefund(myFaction.getLandRounded()); - if(Conf.bankEnabled && Conf.bankFactionPaysLandCosts) + if(ConfServer.bankEnabled && ConfServer.bankFactionPaysLandCosts) { if ( ! Econ.modifyMoney(myFaction, refund, "to unclaim all faction land", "for unclaiming all faction land")) return; } @@ -53,7 +53,7 @@ public class CmdUnclaimall extends FCommand myFaction.msg("%s unclaimed ALL of your faction's land.", fme.describeTo(myFaction, true)); SpoutFeatures.updateTerritoryDisplayLoc(null); - if (Conf.logLandUnclaims) + if (ConfServer.logLandUnclaims) Factions.get().log(fme.getName()+" unclaimed everything for the faction: "+myFaction.getTag()); } diff --git a/src/com/massivecraft/factions/cmd/FCmdRoot.java b/src/com/massivecraft/factions/cmd/FCmdRoot.java index 25365046..89886032 100644 --- a/src/com/massivecraft/factions/cmd/FCmdRoot.java +++ b/src/com/massivecraft/factions/cmd/FCmdRoot.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd; import java.util.Collections; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.Factions; public class FCmdRoot extends FCommand @@ -53,7 +53,7 @@ public class FCmdRoot extends FCommand public FCmdRoot() { super(); - this.aliases.addAll(Conf.baseCommandAliases); + this.aliases.addAll(ConfServer.baseCommandAliases); this.aliases.removeAll(Collections.singletonList(null)); // remove any nulls from extra commas //this.requiredArgs.add(""); diff --git a/src/com/massivecraft/factions/cmd/FCommand.java b/src/com/massivecraft/factions/cmd/FCommand.java index 3b756279..2b6eba26 100644 --- a/src/com/massivecraft/factions/cmd/FCommand.java +++ b/src/com/massivecraft/factions/cmd/FCommand.java @@ -5,7 +5,7 @@ import java.util.List; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayers; @@ -70,13 +70,13 @@ public abstract class FCommand extends MCommand return false; } - if (this.isMoneyCommand && ! Conf.econEnabled) + if (this.isMoneyCommand && ! ConfServer.econEnabled) { msg("Faction economy features are disabled on this server."); return false; } - if (this.isMoneyCommand && ! Conf.bankEnabled) + if (this.isMoneyCommand && ! ConfServer.bankEnabled) { msg("The faction bank system is disabled on this server."); return false; @@ -422,7 +422,7 @@ public abstract class FCommand extends MCommand { if ( ! Econ.shouldBeUsed() || this.fme == null || cost == 0.0 || fme.hasAdminMode()) return true; - if(Conf.bankEnabled && Conf.bankFactionPaysCosts && fme.hasFaction()) + if(ConfServer.bankEnabled && ConfServer.bankFactionPaysCosts && fme.hasFaction()) return Econ.modifyMoney(myFaction, -cost, toDoThis, forDoingThis); else return Econ.modifyMoney(fme, -cost, toDoThis, forDoingThis); @@ -433,7 +433,7 @@ public abstract class FCommand extends MCommand { if ( ! Econ.shouldBeUsed() || this.fme == null || cost == 0.0 || fme.hasAdminMode()) return true; - if(Conf.bankEnabled && Conf.bankFactionPaysCosts && fme.hasFaction()) + if(ConfServer.bankEnabled && ConfServer.bankFactionPaysCosts && fme.hasFaction()) return Econ.hasAtLeast(myFaction, cost, toDoThis); else return Econ.hasAtLeast(fme, cost, toDoThis); diff --git a/src/com/massivecraft/factions/cmd/FRelationCommand.java b/src/com/massivecraft/factions/cmd/FRelationCommand.java index c85d2069..e48949a2 100644 --- a/src/com/massivecraft/factions/cmd/FRelationCommand.java +++ b/src/com/massivecraft/factions/cmd/FRelationCommand.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd; import org.bukkit.Bukkit; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.Faction; import com.massivecraft.factions.Perm; import com.massivecraft.factions.event.FactionRelationEvent; @@ -75,7 +75,7 @@ public abstract class FRelationCommand extends FCommand else { them.msg("%s wishes to be %s.", myFaction.describeTo(them, true), targetRelation.getColor()+targetRelation.getDescFactionOne()); - them.msg("Type /"+Conf.baseCommandAliases.get(0)+" "+targetRelation+" "+myFaction.getTag()+" to accept."); + them.msg("Type /"+ConfServer.baseCommandAliases.get(0)+" "+targetRelation+" "+myFaction.getTag()+" to accept."); myFaction.msg("%s were informed that you wish to be %s.", them.describeTo(myFaction, true), targetRelation.getColor()+targetRelation.getDescFactionOne()); } diff --git a/src/com/massivecraft/factions/integration/Econ.java b/src/com/massivecraft/factions/integration/Econ.java index baffd407..11c3490b 100644 --- a/src/com/massivecraft/factions/integration/Econ.java +++ b/src/com/massivecraft/factions/integration/Econ.java @@ -7,7 +7,7 @@ import java.util.logging.Level; import org.bukkit.Bukkit; import org.bukkit.plugin.RegisteredServiceProvider; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.Faction; import com.massivecraft.factions.FactionColl; @@ -28,7 +28,7 @@ public class Econ { if (isSetup()) return; - String integrationFail = "Economy integration is "+(Conf.econEnabled ? "enabled, but" : "disabled, and")+" the plugin \"Vault\" "; + String integrationFail = "Economy integration is "+(ConfServer.econEnabled ? "enabled, but" : "disabled, and")+" the plugin \"Vault\" "; if (Bukkit.getServer().getPluginManager().getPlugin("Vault") == null) { @@ -46,7 +46,7 @@ public class Econ Factions.get().log("Economy integration through Vault plugin successful."); - if ( ! Conf.econEnabled) + if ( ! ConfServer.econEnabled) Factions.get().log("NOTE: Economy is disabled. You can enable it with the command: f config econEnabled true"); oldMoneyDoTransfer(); @@ -54,7 +54,7 @@ public class Econ public static boolean shouldBeUsed() { - return Conf.econEnabled && econ != null && econ.isEnabled(); + return ConfServer.econEnabled && econ != null && econ.isEnabled(); } public static boolean isSetup() @@ -67,11 +67,11 @@ public class Econ { if (!shouldBeUsed()) return; - if (Conf.econUniverseAccount == null) return; - if (Conf.econUniverseAccount.length() == 0) return; - if ( ! econ.hasAccount(Conf.econUniverseAccount)) return; + if (ConfServer.econUniverseAccount == null) return; + if (ConfServer.econUniverseAccount.length() == 0) return; + if ( ! econ.hasAccount(ConfServer.econUniverseAccount)) return; - modifyBalance(Conf.econUniverseAccount, delta); + modifyBalance(ConfServer.econUniverseAccount, delta); } public static void sendBalanceInfo(FPlayer to, EconomyParticipator about) @@ -318,15 +318,15 @@ public class Econ } // basic claim cost, plus land inflation cost, minus the potential bonus given for claiming from another faction - return Conf.econCostClaimWilderness - + (Conf.econCostClaimWilderness * Conf.econClaimAdditionalMultiplier * ownedLand) - - (takingFromAnotherFaction ? Conf.econCostClaimFromFactionBonus: 0); + return ConfServer.econCostClaimWilderness + + (ConfServer.econCostClaimWilderness * ConfServer.econClaimAdditionalMultiplier * ownedLand) + - (takingFromAnotherFaction ? ConfServer.econCostClaimFromFactionBonus: 0); } // calculate refund amount for unclaiming land public static double calculateClaimRefund(int ownedLand) { - return calculateClaimCost(ownedLand - 1, false) * Conf.econClaimRefundMultiplier; + return calculateClaimCost(ownedLand - 1, false) * ConfServer.econClaimRefundMultiplier; } // calculate value of all owned land @@ -342,7 +342,7 @@ public class Econ // calculate refund amount for all owned land public static double calculateTotalLandRefund(int ownedLand) { - return calculateTotalLandValue(ownedLand) * Conf.econClaimRefundMultiplier; + return calculateTotalLandValue(ownedLand) * ConfServer.econClaimRefundMultiplier; } diff --git a/src/com/massivecraft/factions/integration/EssentialsFeatures.java b/src/com/massivecraft/factions/integration/EssentialsFeatures.java index b7b8720b..de646447 100644 --- a/src/com/massivecraft/factions/integration/EssentialsFeatures.java +++ b/src/com/massivecraft/factions/integration/EssentialsFeatures.java @@ -9,7 +9,7 @@ import org.bukkit.event.Listener; import org.bukkit.Location; import org.bukkit.plugin.Plugin; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.Factions; import com.massivecraft.factions.listeners.FactionsChatListener; @@ -71,10 +71,10 @@ public class EssentialsFeatures // return false if feature is disabled or Essentials isn't available public static boolean handleTeleport(Player player, Location loc) { - if ( ! Conf.homesTeleportCommandEssentialsIntegration || essentials == null) return false; + if ( ! ConfServer.homesTeleportCommandEssentialsIntegration || essentials == null) return false; Teleport teleport = (Teleport) essentials.getUser(player).getTeleport(); - Trade trade = new Trade(Conf.econCostHome, essentials); + Trade trade = new Trade(ConfServer.econCostHome, essentials); try { teleport.teleport(loc, trade); diff --git a/src/com/massivecraft/factions/integration/LWCFeatures.java b/src/com/massivecraft/factions/integration/LWCFeatures.java index a47731e2..2ee67fb0 100644 --- a/src/com/massivecraft/factions/integration/LWCFeatures.java +++ b/src/com/massivecraft/factions/integration/LWCFeatures.java @@ -13,7 +13,7 @@ import org.bukkit.block.BlockState; import com.griefcraft.lwc.LWC; import com.griefcraft.lwc.LWCPlugin; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FLocation; import com.massivecraft.factions.FPlayers; import com.massivecraft.factions.Faction; @@ -29,12 +29,12 @@ public class LWCFeatures if(test == null || !test.isEnabled()) return; lwc = ((LWCPlugin)test).getLWC(); - Factions.get().log("Successfully hooked into LWC!"+(Conf.lwcIntegration ? "" : " Integration is currently disabled, though (\"lwcIntegration\").")); + Factions.get().log("Successfully hooked into LWC!"+(ConfServer.lwcIntegration ? "" : " Integration is currently disabled, though (\"lwcIntegration\").")); } public static boolean getEnabled() { - return Conf.lwcIntegration && lwc != null; + return ConfServer.lwcIntegration && lwc != null; } public static void clearOtherChests(FLocation flocation, Faction faction) diff --git a/src/com/massivecraft/factions/integration/SpoutFeatures.java b/src/com/massivecraft/factions/integration/SpoutFeatures.java index 0bc742b7..b76abcc9 100644 --- a/src/com/massivecraft/factions/integration/SpoutFeatures.java +++ b/src/com/massivecraft/factions/integration/SpoutFeatures.java @@ -4,7 +4,7 @@ import java.util.Arrays; import java.util.HashSet; import java.util.Set; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayers; import com.massivecraft.factions.Faction; @@ -66,7 +66,7 @@ public class SpoutFeatures { // Enabled and non-null? if ( ! isEnabled()) return; - if ( ! Conf.spoutCapes) return; + if ( ! ConfServer.spoutCapes) return; Set fromPlayers = getPlayersFromObject(ofrom); Set toPlayers = getPlayersFromObject(oto); @@ -130,7 +130,7 @@ public class SpoutFeatures { // Enabled and non-null? if ( ! isEnabled()) return; - if ( ! (Conf.spoutFactionTagsOverNames || Conf.spoutFactionTitlesOverNames || Conf.spoutHealthBarUnderNames)) return; + if ( ! (ConfServer.spoutFactionTagsOverNames || ConfServer.spoutFactionTitlesOverNames || ConfServer.spoutHealthBarUnderNames)) return; Set fromPlayers = getPlayersFromObject(ofrom); Set toPlayers = getPlayersFromObject(oto); @@ -187,12 +187,12 @@ public class SpoutFeatures if (faction.isNormal()) { String addTag = ""; - if (Conf.spoutFactionTagsOverNames) + if (ConfServer.spoutFactionTagsOverNames) { addTag += relationColor.toString() + fplayer.getRole().getPrefix() + faction.getTag(); } - if (Conf.spoutFactionTitlesOverNames && ! fplayer.getTitle().isEmpty()) + if (ConfServer.spoutFactionTitlesOverNames && ! fplayer.getTitle().isEmpty()) { addTag += (addTag.isEmpty() ? "" : " ") + fplayer.getTitle(); } @@ -200,7 +200,7 @@ public class SpoutFeatures ret = addTag + "\n" + ret; } - if (Conf.spoutHealthBarUnderNames) + if (ConfServer.spoutHealthBarUnderNames) { ret += "\n"; ret += HealthBarUtil.getHealthbar(player.getHealth() / 20d); diff --git a/src/com/massivecraft/factions/integration/SpoutMainListener.java b/src/com/massivecraft/factions/integration/SpoutMainListener.java index c8523d3d..7c2c6ce0 100644 --- a/src/com/massivecraft/factions/integration/SpoutMainListener.java +++ b/src/com/massivecraft/factions/integration/SpoutMainListener.java @@ -9,7 +9,7 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import com.massivecraft.factions.Board; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FLocation; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayers; @@ -54,7 +54,7 @@ public class SpoutMainListener implements Listener return false; SpoutPlayer sPlayer = SpoutManager.getPlayer(p); - if (!sPlayer.isSpoutCraftEnabled() || (Conf.spoutTerritoryDisplaySize <= 0 && ! Conf.spoutTerritoryNoticeShow)) + if (!sPlayer.isSpoutCraftEnabled() || (ConfServer.spoutTerritoryDisplaySize <= 0 && ! ConfServer.spoutTerritoryNoticeShow)) return false; doLabels(player, sPlayer, notify); @@ -69,7 +69,7 @@ public class SpoutMainListener implements Listener return false; SpoutPlayer sPlayer = SpoutManager.getPlayer(p); - if (!sPlayer.isSpoutCraftEnabled() || (Conf.spoutTerritoryDisplaySize <= 0 && ! Conf.spoutTerritoryNoticeShow)) + if (!sPlayer.isSpoutCraftEnabled() || (ConfServer.spoutTerritoryDisplaySize <= 0 && ! ConfServer.spoutTerritoryNoticeShow)) return false; FLocation here = player.getLastStoodAt(); @@ -96,7 +96,7 @@ public class SpoutMainListener implements Listener // ---------------------- // Main territory display // ---------------------- - if (Conf.spoutTerritoryDisplayPosition > 0 && Conf.spoutTerritoryDisplaySize > 0) + if (ConfServer.spoutTerritoryDisplayPosition > 0 && ConfServer.spoutTerritoryDisplaySize > 0) { GenericLabel label; if (territoryLabels.containsKey(player.getName())) @@ -105,7 +105,7 @@ public class SpoutMainListener implements Listener { label = new GenericLabel(); label.setWidth(1).setHeight(1); // prevent Spout's questionable new "no default size" warning - label.setScale(Conf.spoutTerritoryDisplaySize); + label.setScale(ConfServer.spoutTerritoryDisplaySize); sPlayer.getMainScreen().attachWidget(Factions.get(), label); territoryLabels.put(player.getName(), label); @@ -113,7 +113,7 @@ public class SpoutMainListener implements Listener String msg = tag; - if (Conf.spoutTerritoryDisplayShowDescription && !factionHere.getDescription().isEmpty()) + if (ConfServer.spoutTerritoryDisplayShowDescription && !factionHere.getDescription().isEmpty()) msg += " - " + factionHere.getDescription(); label.setText(msg); @@ -124,24 +124,24 @@ public class SpoutMainListener implements Listener // ----------------------- // Fading territory notice // ----------------------- - if (notify && Conf.spoutTerritoryNoticeShow && Conf.spoutTerritoryNoticeSize > 0) + if (notify && ConfServer.spoutTerritoryNoticeShow && ConfServer.spoutTerritoryNoticeSize > 0) { NoticeLabel label; if (territoryChangeLabels.containsKey(player.getName())) label = territoryChangeLabels.get(player.getName()); else { - label = new NoticeLabel(Conf.spoutTerritoryNoticeLeaveAfterSeconds); + label = new NoticeLabel(ConfServer.spoutTerritoryNoticeLeaveAfterSeconds); label.setWidth(1).setHeight(1); // prevent Spout's questionable new "no default size" warning - label.setScale(Conf.spoutTerritoryNoticeSize); - label.setY(Conf.spoutTerritoryNoticeTop); + label.setScale(ConfServer.spoutTerritoryNoticeSize); + label.setY(ConfServer.spoutTerritoryNoticeTop); sPlayer.getMainScreen().attachWidget(Factions.get(), label); territoryChangeLabels.put(player.getName(), label); } String msg = tag; - if (Conf.spoutTerritoryNoticeShowDescription && !factionHere.getDescription().isEmpty()) + if (ConfServer.spoutTerritoryNoticeShowDescription && !factionHere.getDescription().isEmpty()) msg += " - " + factionHere.getDescription(); label.setText(msg); @@ -158,7 +158,7 @@ public class SpoutMainListener implements Listener private static final Color accessDeniedColor = new Color(1.0f, 0.2f, 0.2f); private void doAccessInfo(FPlayer player, SpoutPlayer sPlayer, FLocation here) { - if (Conf.spoutTerritoryDisplayPosition <= 0 || Conf.spoutTerritoryDisplaySize <= 0 || ! Conf.spoutTerritoryAccessShow) return; + if (ConfServer.spoutTerritoryDisplayPosition <= 0 || ConfServer.spoutTerritoryDisplaySize <= 0 || ! ConfServer.spoutTerritoryAccessShow) return; // ----------- // Access Info @@ -170,8 +170,8 @@ public class SpoutMainListener implements Listener { label = new GenericLabel(); label.setWidth(1).setHeight(1); // prevent Spout's questionable new "no default size" warning - label.setScale(Conf.spoutTerritoryDisplaySize); - label.setY((int)(10 * Conf.spoutTerritoryDisplaySize)); + label.setScale(ConfServer.spoutTerritoryDisplaySize); + label.setY((int)(10 * ConfServer.spoutTerritoryDisplaySize)); sPlayer.getMainScreen().attachWidget(Factions.get(), label); accessLabels.put(player.getName(), label); } @@ -201,11 +201,11 @@ public class SpoutMainListener implements Listener // this is only necessary because Spout text size scaling is currently bugged and breaks their built-in alignment methods public void alignLabel(GenericLabel label, String text) { - alignLabel(label, text, Conf.spoutTerritoryDisplayPosition); + alignLabel(label, text, ConfServer.spoutTerritoryDisplayPosition); } public void alignLabel(GenericLabel label, String text, int alignment) { - int labelWidth = (int)((float)GenericLabel.getStringWidth(text) * Conf.spoutTerritoryDisplaySize); + int labelWidth = (int)((float)GenericLabel.getStringWidth(text) * ConfServer.spoutTerritoryDisplaySize); if (labelWidth > SCREEN_WIDTH) { label.setX(0); diff --git a/src/com/massivecraft/factions/integration/herochat/AlliesChannel.java b/src/com/massivecraft/factions/integration/herochat/AlliesChannel.java index 2e615d27..7096e3c0 100644 --- a/src/com/massivecraft/factions/integration/herochat/AlliesChannel.java +++ b/src/com/massivecraft/factions/integration/herochat/AlliesChannel.java @@ -5,7 +5,7 @@ import java.util.Set; import org.bukkit.ChatColor; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.struct.Rel; public class AlliesChannel extends FactionsChannelAbstract @@ -13,30 +13,30 @@ public class AlliesChannel extends FactionsChannelAbstract public static final Set targetRelations = EnumSet.of(Rel.MEMBER, Rel.ALLY); @Override public Set getTargetRelations() { return targetRelations; } - @Override public String getName() { return Conf.herochatAlliesName; } + @Override public String getName() { return ConfServer.herochatAlliesName; } - @Override public String getNick() { return Conf.herochatAlliesNick; } - @Override public void setNick(String nick) { Conf.herochatAlliesNick = nick; } + @Override public String getNick() { return ConfServer.herochatAlliesNick; } + @Override public void setNick(String nick) { ConfServer.herochatAlliesNick = nick; } - @Override public String getFormat() { return Conf.herochatAlliesFormat; } - @Override public void setFormat(String format) { Conf.herochatAlliesFormat = format; } + @Override public String getFormat() { return ConfServer.herochatAlliesFormat; } + @Override public void setFormat(String format) { ConfServer.herochatAlliesFormat = format; } - @Override public ChatColor getColor() { return Conf.herochatAlliesColor; } - @Override public void setColor(ChatColor color) { Conf.herochatAlliesColor = color; } + @Override public ChatColor getColor() { return ConfServer.herochatAlliesColor; } + @Override public void setColor(ChatColor color) { ConfServer.herochatAlliesColor = color; } - @Override public int getDistance() { return Conf.herochatAlliesDistance; } - @Override public void setDistance(int distance) { Conf.herochatAlliesDistance = distance; } + @Override public int getDistance() { return ConfServer.herochatAlliesDistance; } + @Override public void setDistance(int distance) { ConfServer.herochatAlliesDistance = distance; } - @Override public void addWorld(String world) { Conf.herochatAlliesWorlds.add(world); } - @Override public Set getWorlds() { return Conf.herochatAlliesWorlds; } - @Override public void setWorlds(Set worlds) { Conf.herochatAlliesWorlds = worlds; } + @Override public void addWorld(String world) { ConfServer.herochatAlliesWorlds.add(world); } + @Override public Set getWorlds() { return ConfServer.herochatAlliesWorlds; } + @Override public void setWorlds(Set worlds) { ConfServer.herochatAlliesWorlds = worlds; } - @Override public boolean isShortcutAllowed() { return Conf.herochatAlliesIsShortcutAllowed; } - @Override public void setShortcutAllowed(boolean shortcutAllowed) { Conf.herochatAlliesIsShortcutAllowed = shortcutAllowed; } + @Override public boolean isShortcutAllowed() { return ConfServer.herochatAlliesIsShortcutAllowed; } + @Override public void setShortcutAllowed(boolean shortcutAllowed) { ConfServer.herochatAlliesIsShortcutAllowed = shortcutAllowed; } - @Override public boolean isCrossWorld() { return Conf.herochatAlliesCrossWorld; } - @Override public void setCrossWorld(boolean crossWorld) { Conf.herochatAlliesCrossWorld = crossWorld; } + @Override public boolean isCrossWorld() { return ConfServer.herochatAlliesCrossWorld; } + @Override public void setCrossWorld(boolean crossWorld) { ConfServer.herochatAlliesCrossWorld = crossWorld; } - @Override public boolean isMuted() { return Conf.herochatAlliesMuted; } - @Override public void setMuted(boolean value) { Conf.herochatAlliesMuted = value; } + @Override public boolean isMuted() { return ConfServer.herochatAlliesMuted; } + @Override public void setMuted(boolean value) { ConfServer.herochatAlliesMuted = value; } } diff --git a/src/com/massivecraft/factions/integration/herochat/FactionChannel.java b/src/com/massivecraft/factions/integration/herochat/FactionChannel.java index 62a2d653..ef52e79e 100644 --- a/src/com/massivecraft/factions/integration/herochat/FactionChannel.java +++ b/src/com/massivecraft/factions/integration/herochat/FactionChannel.java @@ -6,7 +6,7 @@ import java.util.Set; import org.bukkit.ChatColor; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.struct.Rel; public class FactionChannel extends FactionsChannelAbstract @@ -14,30 +14,30 @@ public class FactionChannel extends FactionsChannelAbstract public static final Set targetRelations = EnumSet.of(Rel.MEMBER); @Override public Set getTargetRelations() { return targetRelations; } - @Override public String getName() { return Conf.herochatFactionName; } + @Override public String getName() { return ConfServer.herochatFactionName; } - @Override public String getNick() { return Conf.herochatFactionNick; } - @Override public void setNick(String nick) { Conf.herochatFactionNick = nick; } + @Override public String getNick() { return ConfServer.herochatFactionNick; } + @Override public void setNick(String nick) { ConfServer.herochatFactionNick = nick; } - @Override public String getFormat() { return Conf.herochatFactionFormat; } - @Override public void setFormat(String format) { Conf.herochatFactionFormat = format; } + @Override public String getFormat() { return ConfServer.herochatFactionFormat; } + @Override public void setFormat(String format) { ConfServer.herochatFactionFormat = format; } - @Override public ChatColor getColor() { return Conf.herochatFactionColor; } - @Override public void setColor(ChatColor color) { Conf.herochatFactionColor = color; } + @Override public ChatColor getColor() { return ConfServer.herochatFactionColor; } + @Override public void setColor(ChatColor color) { ConfServer.herochatFactionColor = color; } - @Override public int getDistance() { return Conf.herochatFactionDistance; } - @Override public void setDistance(int distance) { Conf.herochatFactionDistance = distance; } + @Override public int getDistance() { return ConfServer.herochatFactionDistance; } + @Override public void setDistance(int distance) { ConfServer.herochatFactionDistance = distance; } - @Override public void addWorld(String world) { Conf.herochatFactionWorlds.add(world); } - @Override public Set getWorlds() { return new HashSet(Conf.herochatFactionWorlds); } - @Override public void setWorlds(Set worlds) { Conf.herochatFactionWorlds = worlds; } + @Override public void addWorld(String world) { ConfServer.herochatFactionWorlds.add(world); } + @Override public Set getWorlds() { return new HashSet(ConfServer.herochatFactionWorlds); } + @Override public void setWorlds(Set worlds) { ConfServer.herochatFactionWorlds = worlds; } - @Override public boolean isShortcutAllowed() { return Conf.herochatFactionIsShortcutAllowed; } - @Override public void setShortcutAllowed(boolean shortcutAllowed) { Conf.herochatFactionIsShortcutAllowed = shortcutAllowed; } + @Override public boolean isShortcutAllowed() { return ConfServer.herochatFactionIsShortcutAllowed; } + @Override public void setShortcutAllowed(boolean shortcutAllowed) { ConfServer.herochatFactionIsShortcutAllowed = shortcutAllowed; } - @Override public boolean isCrossWorld() { return Conf.herochatFactionCrossWorld; } - @Override public void setCrossWorld(boolean crossWorld) { Conf.herochatFactionCrossWorld = crossWorld; } + @Override public boolean isCrossWorld() { return ConfServer.herochatFactionCrossWorld; } + @Override public void setCrossWorld(boolean crossWorld) { ConfServer.herochatFactionCrossWorld = crossWorld; } - @Override public boolean isMuted() { return Conf.herochatFactionMuted; } - @Override public void setMuted(boolean value) { Conf.herochatFactionMuted = value; } + @Override public boolean isMuted() { return ConfServer.herochatFactionMuted; } + @Override public void setMuted(boolean value) { ConfServer.herochatFactionMuted = value; } } diff --git a/src/com/massivecraft/factions/integration/herochat/HerochatListener.java b/src/com/massivecraft/factions/integration/herochat/HerochatListener.java index 6e76b6ff..ae3adb9e 100644 --- a/src/com/massivecraft/factions/integration/herochat/HerochatListener.java +++ b/src/com/massivecraft/factions/integration/herochat/HerochatListener.java @@ -7,7 +7,7 @@ import org.bukkit.event.Listener; import com.dthielke.herochat.ChannelChatEvent; import com.dthielke.herochat.Herochat; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayers; import com.massivecraft.factions.Factions; @@ -30,8 +30,8 @@ public class HerochatListener implements Listener public void onChannelChatEvent(ChannelChatEvent event) { // Should we even parse? - if ( ! Conf.chatParseTags) return; - if (Conf.chatTagHandledByAnotherPlugin) return; + if ( ! ConfServer.chatParseTags) return; + if (ConfServer.chatTagHandledByAnotherPlugin) return; Player from = event.getSender().getPlayer(); FPlayer fpfrom = FPlayers.i.get(from); diff --git a/src/com/massivecraft/factions/listeners/FactionsAppearanceListener.java b/src/com/massivecraft/factions/listeners/FactionsAppearanceListener.java index 6bfee187..9516e1be 100644 --- a/src/com/massivecraft/factions/listeners/FactionsAppearanceListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsAppearanceListener.java @@ -11,7 +11,7 @@ import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.event.player.PlayerTeleportEvent; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.Factions; import com.massivecraft.factions.integration.SpoutFeatures; @@ -61,7 +61,7 @@ public class FactionsAppearanceListener implements Listener public static void possiblyUpdateHealthBar(Entity entity) { - if ( ! Conf.spoutHealthBarUnderNames) return; + if ( ! ConfServer.spoutHealthBarUnderNames) return; if ( ! (entity instanceof Player)) return; Player player = (Player)entity; SpoutFeatures.updateTitle(player, null); diff --git a/src/com/massivecraft/factions/listeners/FactionsBlockListener.java b/src/com/massivecraft/factions/listeners/FactionsBlockListener.java index b07f32b0..7ae7ac01 100644 --- a/src/com/massivecraft/factions/listeners/FactionsBlockListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsBlockListener.java @@ -15,7 +15,7 @@ import org.bukkit.event.block.BlockPistonRetractEvent; import org.bukkit.event.block.BlockSpreadEvent; import com.massivecraft.factions.Board; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FLocation; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayers; @@ -64,7 +64,7 @@ public class FactionsBlockListener implements Listener public static boolean playerCanBuildDestroyBlock(Player player, Location location, String action, boolean justCheck) { String name = player.getName(); - if (Conf.playersWhoBypassAllProtection.contains(name)) return true; + if (ConfServer.playersWhoBypassAllProtection.contains(name)) return true; FPlayer me = FPlayers.i.get(name); if (me.hasAdminMode()) return true; @@ -77,7 +77,7 @@ public class FactionsBlockListener implements Listener if (!justCheck) { me.msg("It is painful to %s in the territory of %s.", action, factionHere.describeTo(me)); - player.damage(Conf.actionDeniedPainAmount); + player.damage(ConfServer.actionDeniedPainAmount); } return true; } @@ -122,7 +122,7 @@ public class FactionsBlockListener implements Listener public void onBlockPistonExtend(BlockPistonExtendEvent event) { if (event.isCancelled()) return; - if ( ! Conf.pistonProtectionThroughDenyBuild) return; + if ( ! ConfServer.pistonProtectionThroughDenyBuild) return; Faction pistonFaction = Board.getFactionAt(new FLocation(event.getBlock())); @@ -150,7 +150,7 @@ public class FactionsBlockListener implements Listener public void onBlockPistonRetract(BlockPistonRetractEvent event) { // if not a sticky piston, retraction should be fine - if (event.isCancelled() || !event.isSticky() || !Conf.pistonProtectionThroughDenyBuild) return; + if (event.isCancelled() || !event.isSticky() || !ConfServer.pistonProtectionThroughDenyBuild) return; Location targetLoc = event.getRetractLocation(); diff --git a/src/com/massivecraft/factions/listeners/FactionsChatListener.java b/src/com/massivecraft/factions/listeners/FactionsChatListener.java index bb002b6e..65ba2255 100644 --- a/src/com/massivecraft/factions/listeners/FactionsChatListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsChatListener.java @@ -21,7 +21,7 @@ import org.bukkit.plugin.AuthorNagException; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.RegisteredListener; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayers; import com.massivecraft.factions.Factions; @@ -58,9 +58,9 @@ public class FactionsChatListener implements Listener @EventHandler(priority = EventPriority.LOW, ignoreCancelled=true) public void lowPlayerChatEvent(AsyncPlayerChatEvent event) { - if (Conf.chatSetFormat) + if (ConfServer.chatSetFormat) { - event.setFormat(Conf.chatSetFormatTo); + event.setFormat(ConfServer.chatSetFormatTo); } } @@ -83,8 +83,8 @@ public class FactionsChatListener implements Listener public void onPlayerChat(AsyncPlayerChatEvent event) { // Should we even parse? - if ( ! Conf.chatParseTags) return; - if (Conf.chatTagHandledByAnotherPlugin) return; + if ( ! ConfServer.chatParseTags) return; + if (ConfServer.chatTagHandledByAnotherPlugin) return; Player from = event.getPlayer(); FPlayer fpfrom = FPlayers.i.get(from); @@ -93,7 +93,7 @@ public class FactionsChatListener implements Listener String formatWithoutColor = parseTags(format, from, fpfrom); - if ( ! Conf.chatParseTagsColored) + if ( ! ConfServer.chatParseTagsColored) { // The case without color is really this simple (: event.setFormat(formatWithoutColor); @@ -253,7 +253,7 @@ public class FactionsChatListener implements Listener if (str.length() == 0) return str; for (String formatName : formatNames) { - String format = Conf.chatSingleFormats.get(formatName); + String format = ConfServer.chatSingleFormats.get(formatName); try { str = String.format(format, str); diff --git a/src/com/massivecraft/factions/listeners/FactionsEntityListener.java b/src/com/massivecraft/factions/listeners/FactionsEntityListener.java index bae96155..d5e4f309 100644 --- a/src/com/massivecraft/factions/listeners/FactionsEntityListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsEntityListener.java @@ -39,7 +39,7 @@ import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import com.massivecraft.factions.Board; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FLocation; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayers; @@ -77,7 +77,7 @@ public class FactionsEntityListener implements Listener powerLossEvent.setMessage("You didn't lose any power since the territory you died in works that way."); powerLossEvent.setCancelled(true); } - else if (Conf.worldsNoPowerLoss.contains(player.getWorld().getName())) + else if (ConfServer.worldsNoPowerLoss.contains(player.getWorld().getName())) { powerLossEvent.setMessage("You didn't lose any power due to the world you died in."); powerLossEvent.setCancelled(true); @@ -148,7 +148,7 @@ public class FactionsEntityListener implements Listener // this optional change below provides workaround for waterwalling providing perfect protection, // and makes cheap (non-obsidian) TNT cannons require minor maintenance between shots Block center = event.getLocation().getBlock(); - if (event.getEntity() instanceof TNTPrimed && Conf.handleExploitTNTWaterlog && center.isLiquid()) + if (event.getEntity() instanceof TNTPrimed && ConfServer.handleExploitTNTWaterlog && center.isLiquid()) { // a single surrounding block in all 6 directions is broken if the material is weak enough List targets = new ArrayList(); @@ -270,11 +270,11 @@ public class FactionsEntityListener implements Listener if (attacker == null || attacker.getPlayer() == null) return true; - if (Conf.playersWhoBypassAllProtection.contains(attacker.getName())) return true; + if (ConfServer.playersWhoBypassAllProtection.contains(attacker.getName())) return true; if (attacker.hasLoginPvpDisabled()) { - if (notify) attacker.msg("You can't hurt other players for " + Conf.noPVPDamageToOthersForXSecondsAfterLogin + " seconds after logging in."); + if (notify) attacker.msg("You can't hurt other players for " + ConfServer.noPVPDamageToOthersForXSecondsAfterLogin + " seconds after logging in."); return false; } @@ -287,25 +287,25 @@ public class FactionsEntityListener implements Listener return false; } - if (Conf.worldsIgnorePvP.contains(defenderLoc.getWorld().getName())) + if (ConfServer.worldsIgnorePvP.contains(defenderLoc.getWorld().getName())) return true; Faction defendFaction = defender.getFaction(); Faction attackFaction = attacker.getFaction(); - if (attackFaction.isNone() && Conf.disablePVPForFactionlessPlayers) + if (attackFaction.isNone() && ConfServer.disablePVPForFactionlessPlayers) { if (notify) attacker.msg("You can't hurt other players until you join a faction."); return false; } else if (defendFaction.isNone()) { - if (defLocFaction == attackFaction && Conf.enablePVPAgainstFactionlessInAttackersLand) + if (defLocFaction == attackFaction && ConfServer.enablePVPAgainstFactionlessInAttackersLand) { // Allow PVP vs. Factionless in attacker's faction territory return true; } - else if (Conf.disablePVPForFactionlessPlayers) + else if (ConfServer.disablePVPForFactionlessPlayers) { if (notify) attacker.msg("You can't hurt players who are not currently in a faction."); return false; @@ -315,7 +315,7 @@ public class FactionsEntityListener implements Listener Rel relation = defendFaction.getRelationTo(attackFaction); // Check the relation - if (defender.hasFaction() && relation.isAtLeast(Conf.friendlyFireFromRel) && defLocFaction.getFlag(FFlag.FRIENDLYFIRE) == false) + if (defender.hasFaction() && relation.isAtLeast(ConfServer.friendlyFireFromRel) && defLocFaction.getFlag(FFlag.FRIENDLYFIRE) == false) { if (notify) attacker.msg("You can't hurt %s.", relation.getDescPlayerMany()); return false; @@ -334,15 +334,15 @@ public class FactionsEntityListener implements Listener } // Damage will be dealt. However check if the damage should be reduced. - if (damage > 0.0 && defender.hasFaction() && ownTerritory && Conf.territoryShieldFactor > 0) + if (damage > 0.0 && defender.hasFaction() && ownTerritory && ConfServer.territoryShieldFactor > 0) { - int newDamage = (int)Math.ceil(damage * (1D - Conf.territoryShieldFactor)); + int newDamage = (int)Math.ceil(damage * (1D - ConfServer.territoryShieldFactor)); sub.setDamage(newDamage); // Send message if (notify) { - String perc = MessageFormat.format("{0,number,#%}", (Conf.territoryShieldFactor)); // TODO does this display correctly?? + String perc = MessageFormat.format("{0,number,#%}", (ConfServer.territoryShieldFactor)); // TODO does this display correctly?? defender.msg("Enemy damage reduced by %s.", perc); } } @@ -360,7 +360,7 @@ public class FactionsEntityListener implements Listener Faction faction = Board.getFactionAt(floc); if (faction.getFlag(FFlag.MONSTERS)) return; - if ( ! Conf.monsters.contains(event.getEntityType())) return; + if ( ! ConfServer.monsters.contains(event.getEntityType())) return; event.setCancelled(true); } @@ -375,7 +375,7 @@ public class FactionsEntityListener implements Listener if (target == null) return; // We are interested in blocking targeting for certain mobs: - if ( ! Conf.monsters.contains(MiscUtil.creatureTypeFromEntity(event.getEntity()))) return; + if ( ! ConfServer.monsters.contains(MiscUtil.creatureTypeFromEntity(event.getEntity()))) return; FLocation floc = new FLocation(target.getLocation()); Faction faction = Board.getFactionAt(floc); diff --git a/src/com/massivecraft/factions/listeners/FactionsExploitListener.java b/src/com/massivecraft/factions/listeners/FactionsExploitListener.java index 42ccd4c4..07c1b1cb 100644 --- a/src/com/massivecraft/factions/listeners/FactionsExploitListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsExploitListener.java @@ -9,7 +9,7 @@ import org.bukkit.event.Listener; import org.bukkit.Location; import org.bukkit.Material; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; public class FactionsExploitListener implements Listener @@ -17,7 +17,7 @@ public class FactionsExploitListener implements Listener @EventHandler(priority = EventPriority.NORMAL) public void obsidianGenerator(BlockFromToEvent event) { - if (event.isCancelled() == true || ! Conf.handleExploitObsidianGenerators) return; + if (event.isCancelled() == true || ! ConfServer.handleExploitObsidianGenerators) return; // thanks to ObGenBlocker and WorldGuard for this method Block block = event.getToBlock(); @@ -31,7 +31,7 @@ public class FactionsExploitListener implements Listener @EventHandler(priority = EventPriority.NORMAL) public void enderPearlTeleport(PlayerTeleportEvent event) { - if (event.isCancelled() == true || ! Conf.handleExploitEnderPearlClipping) return; + if (event.isCancelled() == true || ! ConfServer.handleExploitEnderPearlClipping) return; if (event.getCause() != PlayerTeleportEvent.TeleportCause.ENDER_PEARL) return; // this exploit works when the target location is within 0.31 blocks or so of a door or glass block or similar... diff --git a/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java b/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java index 4363e152..611d6d36 100644 --- a/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java @@ -25,7 +25,7 @@ import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.util.NumberConversions; import com.massivecraft.factions.Board; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FLocation; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayers; @@ -149,7 +149,7 @@ public class FactionsPlayerListener implements Listener if ( ! canPlayerUseBlock(player, block, false)) { event.setCancelled(true); - if (Conf.handleExploitInteractionSpam) + if (ConfServer.handleExploitInteractionSpam) { String name = player.getName(); InteractAttemptSpam attempt = interactSpammers.get(name); @@ -205,26 +205,26 @@ public class FactionsPlayerListener implements Listener public static boolean playerCanUseItemHere(Player player, Location loc, Material material, boolean justCheck) { String name = player.getName(); - if (Conf.playersWhoBypassAllProtection.contains(name)) return true; + if (ConfServer.playersWhoBypassAllProtection.contains(name)) return true; FPlayer me = FPlayers.i.get(name); if (me.hasAdminMode()) return true; - if (Conf.materialsEditTools.contains(material) && ! FPerm.BUILD.has(me, loc, ! justCheck)) return false; + if (ConfServer.materialsEditTools.contains(material) && ! FPerm.BUILD.has(me, loc, ! justCheck)) return false; return true; } public static boolean canPlayerUseBlock(Player player, Block block, boolean justCheck) { String name = player.getName(); - if (Conf.playersWhoBypassAllProtection.contains(name)) return true; + if (ConfServer.playersWhoBypassAllProtection.contains(name)) return true; FPlayer me = FPlayers.i.get(name); if (me.hasAdminMode()) return true; Location loc = block.getLocation(); Material material = block.getType(); - if (Conf.materialsEditOnInteract.contains(material) && ! FPerm.BUILD.has(me, loc, ! justCheck)) return false; - if (Conf.materialsContainer.contains(material) && ! FPerm.CONTAINER.has(me, loc, ! justCheck)) return false; - if (Conf.materialsDoor.contains(material) && ! FPerm.DOOR.has(me, loc, ! justCheck)) return false; + if (ConfServer.materialsEditOnInteract.contains(material) && ! FPerm.BUILD.has(me, loc, ! justCheck)) return false; + if (ConfServer.materialsContainer.contains(material) && ! FPerm.CONTAINER.has(me, loc, ! justCheck)) return false; + if (ConfServer.materialsDoor.contains(material) && ! FPerm.DOOR.has(me, loc, ! justCheck)) return false; if (material == Material.STONE_BUTTON && ! FPerm.BUTTON.has(me, loc, ! justCheck)) return false; if (material == Material.LEVER && ! FPerm.LEVER.has(me, loc, ! justCheck)) return false; return true; @@ -240,16 +240,16 @@ public class FactionsPlayerListener implements Listener Location home = me.getFaction().getHome(); // TODO: WARNING FOR NPE HERE THE ORIO FOR RESPAWN SHOULD BE ASSIGNABLE FROM CONFIG. if ( - Conf.homesEnabled + ConfServer.homesEnabled && - Conf.homesTeleportToOnDeath + ConfServer.homesTeleportToOnDeath && home != null && ( - Conf.homesRespawnFromNoPowerLossWorlds + ConfServer.homesRespawnFromNoPowerLossWorlds || - ! Conf.worldsNoPowerLoss.contains(event.getPlayer().getWorld().getName()) + ! ConfServer.worldsNoPowerLoss.contains(event.getPlayer().getWorld().getName()) ) ) { @@ -301,7 +301,7 @@ public class FactionsPlayerListener implements Listener // The full command is converted to lowercase and does include the slash in the front String fullCmd = event.getMessage().toLowerCase(); - if (me.hasFaction() && me.getFaction().getFlag(FFlag.PERMANENT) && isCommandInList(fullCmd, Conf.permanentFactionMemberDenyCommands)) + if (me.hasFaction() && me.getFaction().getFlag(FFlag.PERMANENT) && isCommandInList(fullCmd, ConfServer.permanentFactionMemberDenyCommands)) { me.msg("You can't use the command \""+fullCmd+"\" because you are in a permanent faction."); event.setCancelled(true); @@ -311,14 +311,14 @@ public class FactionsPlayerListener implements Listener Rel rel = me.getRelationToLocation(); if (Board.getFactionAt(me.getLastStoodAt()).isNone()) return; - if (rel == Rel.NEUTRAL && isCommandInList(fullCmd, Conf.territoryNeutralDenyCommands)) + if (rel == Rel.NEUTRAL && isCommandInList(fullCmd, ConfServer.territoryNeutralDenyCommands)) { me.msg("You can't use the command \""+fullCmd+"\" in neutral territory."); event.setCancelled(true); return; } - if (rel == Rel.ENEMY && isCommandInList(fullCmd, Conf.territoryEnemyDenyCommands)) + if (rel == Rel.ENEMY && isCommandInList(fullCmd, ConfServer.territoryEnemyDenyCommands)) { me.msg("You can't use the command \""+fullCmd+"\" in enemy territory."); event.setCancelled(true); @@ -361,7 +361,7 @@ public class FactionsPlayerListener implements Listener SpoutFeatures.playerDisconnect(badGuy); // if player was banned (not just kicked), get rid of their stored info - if (Conf.removePlayerDataWhenBanned && event.getReason().equals("Banned by admin.")) + if (ConfServer.removePlayerDataWhenBanned && event.getReason().equals("Banned by admin.")) { if (badGuy.getRole() == Rel.LEADER) badGuy.getFaction().promoteNewLeader(); diff --git a/src/com/massivecraft/factions/struct/FFlag.java b/src/com/massivecraft/factions/struct/FFlag.java index 43a2bad7..85fd301d 100644 --- a/src/com/massivecraft/factions/struct/FFlag.java +++ b/src/com/massivecraft/factions/struct/FFlag.java @@ -1,6 +1,6 @@ package com.massivecraft.factions.struct; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; /** * Flags that describe the nature of a faction and it's territory. @@ -55,7 +55,7 @@ public enum FFlag */ public boolean getDefault() { - Boolean ret = Conf.factionFlagDefaults.get(this); + Boolean ret = ConfServer.factionFlagDefaults.get(this); if (ret == null) return this.defaultDefaultValue; return ret; } diff --git a/src/com/massivecraft/factions/struct/FPerm.java b/src/com/massivecraft/factions/struct/FPerm.java index 2e062a39..defac771 100644 --- a/src/com/massivecraft/factions/struct/FPerm.java +++ b/src/com/massivecraft/factions/struct/FPerm.java @@ -10,7 +10,7 @@ import org.bukkit.command.ConsoleCommandSender; import org.bukkit.entity.Player; import com.massivecraft.factions.Board; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FLocation; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayers; @@ -66,7 +66,7 @@ public enum FPerm public Set getDefault() { - Set ret = Conf.factionPermDefaults.get(this); + Set ret = ConfServer.factionPermDefaults.get(this); if (ret == null) return this.defaultDefaultValue; return ret; } diff --git a/src/com/massivecraft/factions/struct/Rel.java b/src/com/massivecraft/factions/struct/Rel.java index f38380f1..968e6044 100644 --- a/src/com/massivecraft/factions/struct/Rel.java +++ b/src/com/massivecraft/factions/struct/Rel.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.struct; import org.bukkit.ChatColor; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; public enum Rel { @@ -96,37 +96,37 @@ public enum Rel public ChatColor getColor() { if (this.isAtLeast(RECRUIT)) - return Conf.colorMember; + return ConfServer.colorMember; else if (this == ALLY) - return Conf.colorAlly; + return ConfServer.colorAlly; else if (this == NEUTRAL) - return Conf.colorNeutral; + return ConfServer.colorNeutral; else if (this == TRUCE) - return Conf.colorTruce; + return ConfServer.colorTruce; else - return Conf.colorEnemy; + return ConfServer.colorEnemy; } public String getPrefix() { if (this == LEADER) { - return Conf.prefixLeader; + return ConfServer.prefixLeader; } if (this == OFFICER) { - return Conf.prefixOfficer; + return ConfServer.prefixOfficer; } if (this == MEMBER) { - return Conf.prefixMember; + return ConfServer.prefixMember; } if (this == RECRUIT) { - return Conf.prefixRecruit; + return ConfServer.prefixRecruit; } return ""; @@ -137,12 +137,12 @@ public enum Rel public double getRelationCost() { if (this == ENEMY) - return Conf.econCostEnemy; + return ConfServer.econCostEnemy; else if (this == ALLY) - return Conf.econCostAlly; + return ConfServer.econCostAlly; else if (this == TRUCE) - return Conf.econCostTruce; + return ConfServer.econCostTruce; else - return Conf.econCostNeutral; + return ConfServer.econCostNeutral; } } diff --git a/src/com/massivecraft/factions/util/AutoLeaveTask.java b/src/com/massivecraft/factions/util/AutoLeaveTask.java index e02f22d1..c6558002 100644 --- a/src/com/massivecraft/factions/util/AutoLeaveTask.java +++ b/src/com/massivecraft/factions/util/AutoLeaveTask.java @@ -1,6 +1,6 @@ package com.massivecraft.factions.util; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FPlayers; import com.massivecraft.factions.Factions; @@ -10,7 +10,7 @@ public class AutoLeaveTask implements Runnable public AutoLeaveTask() { - this.rate = Conf.autoLeaveRoutineRunsEveryXMinutes; + this.rate = ConfServer.autoLeaveRoutineRunsEveryXMinutes; } public void run() @@ -18,7 +18,7 @@ public class AutoLeaveTask implements Runnable FPlayers.i.autoLeaveOnInactivityRoutine(); // maybe setting has been changed? if so, restart task at new rate - if (this.rate != Conf.autoLeaveRoutineRunsEveryXMinutes) + if (this.rate != ConfServer.autoLeaveRoutineRunsEveryXMinutes) Factions.get().startAutoLeaveTask(true); } } diff --git a/src/com/massivecraft/factions/util/EconLandRewardTask.java b/src/com/massivecraft/factions/util/EconLandRewardTask.java index 6799e3c5..365c6de8 100644 --- a/src/com/massivecraft/factions/util/EconLandRewardTask.java +++ b/src/com/massivecraft/factions/util/EconLandRewardTask.java @@ -1,6 +1,6 @@ package com.massivecraft.factions.util; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FactionColl; import com.massivecraft.factions.Factions; @@ -10,7 +10,7 @@ public class EconLandRewardTask implements Runnable { public EconLandRewardTask() { - this.rate = Conf.econLandRewardTaskRunsEveryXMinutes; + this.rate = ConfServer.econLandRewardTaskRunsEveryXMinutes; } @Override @@ -18,7 +18,7 @@ public class EconLandRewardTask implements Runnable { { FactionColl.i.econLandRewardRoutine(); // maybe setting has been changed? if so, restart task at new rate - if (this.rate != Conf.econLandRewardTaskRunsEveryXMinutes) + if (this.rate != ConfServer.econLandRewardTaskRunsEveryXMinutes) Factions.get().startEconLandRewardTask(true); } diff --git a/src/com/massivecraft/factions/util/HealthBarUtil.java b/src/com/massivecraft/factions/util/HealthBarUtil.java index 0a6b2c95..90d3ec3a 100644 --- a/src/com/massivecraft/factions/util/HealthBarUtil.java +++ b/src/com/massivecraft/factions/util/HealthBarUtil.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.util; import java.util.Map.Entry; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.zcore.util.TextUtil; public class HealthBarUtil @@ -19,10 +19,10 @@ public class HealthBarUtil int solidCount = (int) Math.ceil(barLength * healthQuota); // The rest is empty - int emptyCount = (int) ((barLength - solidCount) / Conf.spoutHealthBarSolidsPerEmpty); + int emptyCount = (int) ((barLength - solidCount) / ConfServer.spoutHealthBarSolidsPerEmpty); // Create the non-parsed bar - String ret = Conf.spoutHealthBarLeft + TextUtil.repeat(Conf.spoutHealthBarSolid, solidCount) + Conf.spoutHealthBarBetween + TextUtil.repeat(Conf.spoutHealthBarEmpty, emptyCount) + Conf.spoutHealthBarRight; + String ret = ConfServer.spoutHealthBarLeft + TextUtil.repeat(ConfServer.spoutHealthBarSolid, solidCount) + ConfServer.spoutHealthBarBetween + TextUtil.repeat(ConfServer.spoutHealthBarEmpty, emptyCount) + ConfServer.spoutHealthBarRight; // Replace color tag ret = ret.replace("{c}", color); @@ -35,7 +35,7 @@ public class HealthBarUtil public static String getHealthbar(double healthQuota) { - return getHealthbar(healthQuota, Conf.spoutHealthBarWidth); + return getHealthbar(healthQuota, ConfServer.spoutHealthBarWidth); } public static double fixQuota(double healthQuota) @@ -55,7 +55,7 @@ public class HealthBarUtil { Double currentRoof = null; String ret = null; - for (Entry entry : Conf.spoutHealthBarColorUnderQuota.entrySet()) + for (Entry entry : ConfServer.spoutHealthBarColorUnderQuota.entrySet()) { double roof = entry.getKey(); String color = entry.getValue(); diff --git a/src/com/massivecraft/factions/util/RelationUtil.java b/src/com/massivecraft/factions/util/RelationUtil.java index daea2d85..1a41a1bd 100644 --- a/src/com/massivecraft/factions/util/RelationUtil.java +++ b/src/com/massivecraft/factions/util/RelationUtil.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.util; import org.bukkit.ChatColor; -import com.massivecraft.factions.Conf; +import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.Faction; import com.massivecraft.factions.iface.RelationParticipator; @@ -135,12 +135,12 @@ public class RelationUtil { if (thatFaction.getFlag(FFlag.FRIENDLYFIRE) == true) { - return Conf.colorFriendlyFire; + return ConfServer.colorFriendlyFire; } if (thatFaction.getFlag(FFlag.PVP) == false) { - return Conf.colorNoPVP; + return ConfServer.colorNoPVP; } } return getRelationOfThatToMe(that, me).getColor();