From 559695d103ecaaeecf207a70c9b0a1450ee317f5 Mon Sep 17 00:00:00 2001 From: drtshock Date: Thu, 29 Jan 2015 08:30:20 -0600 Subject: [PATCH] Fix check for over claiming. Resolves #230. --- .../com/massivecraft/factions/zcore/persist/MemoryFPlayer.java | 3 +++ src/main/java/com/massivecraft/factions/zcore/util/TL.java | 1 + src/main/resources/config.yml | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java index 1d55a493..df571a94 100644 --- a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java +++ b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java @@ -702,6 +702,9 @@ public abstract class MemoryFPlayer implements FPlayer { } else if (!currentFaction.hasLandInflation()) { // TODO more messages WARN current faction most importantly error = P.p.txt.parse(TL.CLAIM_THISISSPARTA.toString(), currentFaction.getTag(this)); + } else if (currentFaction.hasLandInflation() && !P.p.getConfig().getBoolean("hcf.allow-overclaim", true)) { + // deny over claim when it normally would be allowed. + error = P.p.txt.parse(TL.CLAIM_OVERCLAIM_DISABLED.toString()); } else if (!Board.getInstance().isBorderLocation(flocation)) { error = P.p.txt.parse(TL.CLAIM_BORDER.toString()); } diff --git a/src/main/java/com/massivecraft/factions/zcore/util/TL.java b/src/main/java/com/massivecraft/factions/zcore/util/TL.java index 5e72948d..a385db5a 100644 --- a/src/main/java/com/massivecraft/factions/zcore/util/TL.java +++ b/src/main/java/com/massivecraft/factions/zcore/util/TL.java @@ -536,6 +536,7 @@ public enum TL { CLAIM_FORCLAIM("for claiming this land"), CLAIM_CLAIMED("%s claimed land for %s from %s."), CLAIM_CLAIMEDLOG("%s claimed land at (%s) for the faction: %s"), + CLAIM_OVERCLAIM_DISABLED("Over claiming is disabled on this server."), /** * More generic, or less easily categorisable translations, which may apply to more than one class diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index ae36aeb5..1f09df97 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -182,7 +182,7 @@ hcf: # Should we allow Factions to over claim if they are raidable (above has no effect on this)? # This has always been true, allowing factions to over claim others. - overclaim: true + allow-overclaim: true # Power Freeze # After a player dies, how long should the faction not be able to regen power?