diff --git a/pom.xml b/pom.xml index c1b2f08d..858ff24f 100644 --- a/pom.xml +++ b/pom.xml @@ -55,11 +55,6 @@ 1.2.27 provided - - com.griefcraft - lwc - 4.4.0-SNAPSHOT - net.ess3 Essentials @@ -91,10 +86,6 @@ bukkit-repo http://repo.bukkit.org/content/groups/public/ - - mcstats.releases - http://repo.mcstats.org/content/repositories/ - essrel http://repo.ess3.net/content/repositories/essrel diff --git a/src/main/java/com/massivecraft/factions/Board.java b/src/main/java/com/massivecraft/factions/Board.java index 3e56622a..8c9e4ba7 100644 --- a/src/main/java/com/massivecraft/factions/Board.java +++ b/src/main/java/com/massivecraft/factions/Board.java @@ -1,6 +1,5 @@ package com.massivecraft.factions; -import com.massivecraft.factions.integration.LWCFeatures; import com.massivecraft.factions.struct.Relation; import com.massivecraft.factions.util.AsciiCompass; import com.massivecraft.factions.zcore.util.DiscUtil; @@ -69,9 +68,6 @@ public class Board { while (iter.hasNext()) { Entry entry = iter.next(); if (entry.getValue().equals(factionId)) { - if (Conf.onUnclaimResetLwcLocks && LWCFeatures.getEnabled()) { - LWCFeatures.clearAllChests(entry.getKey()); - } iter.remove(); } } @@ -107,9 +103,7 @@ public class Board { while (iter.hasNext()) { Entry entry = iter.next(); if (!Factions.i.exists(entry.getValue())) { - if (Conf.onUnclaimResetLwcLocks && LWCFeatures.getEnabled()) { - LWCFeatures.clearAllChests(entry.getKey()); - } + P.p.log("Board cleaner removed " + entry.getValue() + " from " + entry.getKey()); iter.remove(); } diff --git a/src/main/java/com/massivecraft/factions/FPlayer.java b/src/main/java/com/massivecraft/factions/FPlayer.java index 23c883dd..5ae08a42 100644 --- a/src/main/java/com/massivecraft/factions/FPlayer.java +++ b/src/main/java/com/massivecraft/factions/FPlayer.java @@ -5,7 +5,6 @@ import com.massivecraft.factions.event.LandClaimEvent; import com.massivecraft.factions.iface.EconomyParticipator; import com.massivecraft.factions.iface.RelationParticipator; import com.massivecraft.factions.integration.Econ; -import com.massivecraft.factions.integration.LWCFeatures; import com.massivecraft.factions.integration.Worldguard; import com.massivecraft.factions.struct.ChatMode; import com.massivecraft.factions.struct.Permission; @@ -735,10 +734,6 @@ 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) { - LWCFeatures.clearOtherChests(flocation, this.getFaction()); - } - // announce success Set informTheseFPlayers = new HashSet(); informTheseFPlayers.add(this); diff --git a/src/main/java/com/massivecraft/factions/Faction.java b/src/main/java/com/massivecraft/factions/Faction.java index 393ae35a..a3c681c1 100644 --- a/src/main/java/com/massivecraft/factions/Faction.java +++ b/src/main/java/com/massivecraft/factions/Faction.java @@ -3,7 +3,6 @@ package com.massivecraft.factions; import com.massivecraft.factions.iface.EconomyParticipator; import com.massivecraft.factions.iface.RelationParticipator; import com.massivecraft.factions.integration.Econ; -import com.massivecraft.factions.integration.LWCFeatures; import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.struct.Relation; import com.massivecraft.factions.struct.Role; @@ -545,9 +544,6 @@ public class Faction extends Entity implements EconomyParticipator { } public void clearClaimOwnership(FLocation loc) { - if (Conf.onUnclaimResetLwcLocks && LWCFeatures.getEnabled()) { - LWCFeatures.clearAllChests(loc); - } claimOwnership.remove(loc); } @@ -572,9 +568,6 @@ public class Faction extends Entity implements EconomyParticipator { } if (ownerData.isEmpty()) { - if (Conf.onUnclaimResetLwcLocks && LWCFeatures.getEnabled()) { - LWCFeatures.clearAllChests(entry.getKey()); - } claimOwnership.remove(entry.getKey()); } } diff --git a/src/main/java/com/massivecraft/factions/P.java b/src/main/java/com/massivecraft/factions/P.java index e61fbb18..350d6795 100644 --- a/src/main/java/com/massivecraft/factions/P.java +++ b/src/main/java/com/massivecraft/factions/P.java @@ -4,7 +4,6 @@ import com.massivecraft.factions.cmd.CmdAutoHelp; import com.massivecraft.factions.cmd.FCmdRoot; import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.integration.EssentialsFeatures; -import com.massivecraft.factions.integration.LWCFeatures; import com.massivecraft.factions.integration.Worldguard; import com.massivecraft.factions.listeners.*; import com.massivecraft.factions.struct.ChatMode; @@ -101,7 +100,6 @@ public class P extends MPlugin { EssentialsFeatures.setup(); Econ.setup(); - LWCFeatures.setup(); if (Conf.worldGuardChecking || Conf.worldGuardBuildPriority) { Worldguard.init(this); diff --git a/src/main/java/com/massivecraft/factions/integration/LWCFeatures.java b/src/main/java/com/massivecraft/factions/integration/LWCFeatures.java deleted file mode 100644 index 19192a43..00000000 --- a/src/main/java/com/massivecraft/factions/integration/LWCFeatures.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.massivecraft.factions.integration; - -import com.griefcraft.lwc.LWC; -import com.griefcraft.lwc.LWCPlugin; -import com.massivecraft.factions.*; -import org.bukkit.Bukkit; -import org.bukkit.Chunk; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.block.BlockState; -import org.bukkit.plugin.Plugin; - -import java.util.LinkedList; -import java.util.List; - -public class LWCFeatures { - private static LWC lwc; - - public static void setup() { - Plugin test = Bukkit.getServer().getPluginManager().getPlugin("LWC"); - if (test == null || !test.isEnabled()) return; - - lwc = ((LWCPlugin) test).getLWC(); - P.p.log("Successfully hooked into LWC!" + (Conf.lwcIntegration ? "" : " Integration is currently disabled, though (\"lwcIntegration\").")); - } - - public static boolean getEnabled() { - return Conf.lwcIntegration && lwc != null; - } - - public static void clearOtherChests(FLocation flocation, Faction faction) { - Location location = new Location(Bukkit.getWorld(flocation.getWorldName()), flocation.getX() * 16, 5, flocation.getZ() * 16); - if (location.getWorld() == null) return; // world not loaded or something? cancel out to prevent error - Chunk chunk = location.getChunk(); - BlockState[] blocks = chunk.getTileEntities(); - List chests = new LinkedList(); - - for (int x = 0; x < blocks.length; x++) { - if (blocks[x].getType() == Material.CHEST) { - chests.add(blocks[x].getBlock()); - } - } - - for (int x = 0; x < chests.size(); x++) { - if (lwc.findProtection(chests.get(x)) != null) { - if (!faction.getFPlayers().contains(FPlayers.i.get(lwc.findProtection(chests.get(x)).getOwner()))) - lwc.findProtection(chests.get(x)).remove(); - } - } - } - - public static void clearAllChests(FLocation flocation) { - Location location = new Location(Bukkit.getWorld(flocation.getWorldName()), flocation.getX() * 16, 5, flocation.getZ() * 16); - if (location.getWorld() == null) return; // world not loaded or something? cancel out to prevent error - Chunk chunk = location.getChunk(); - BlockState[] blocks = chunk.getTileEntities(); - List chests = new LinkedList(); - - for (int x = 0; x < blocks.length; x++) { - if (blocks[x].getType() == Material.CHEST) { - chests.add(blocks[x].getBlock()); - } - } - - for (int x = 0; x < chests.size(); x++) { - if (lwc.findProtection(chests.get(x)) != null) { - lwc.findProtection(chests.get(x)).remove(); - } - } - } -}