From 5ddfb19861f5e2e603304be5de1647791318540b Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Thu, 18 Apr 2013 17:47:42 +0200 Subject: [PATCH] Make some notes in the source saying that we should use event based integration. --- src/com/massivecraft/factions/Board.java | 2 +- src/com/massivecraft/factions/FPlayer.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/com/massivecraft/factions/Board.java b/src/com/massivecraft/factions/Board.java index 25473cb9..6684989f 100644 --- a/src/com/massivecraft/factions/Board.java +++ b/src/com/massivecraft/factions/Board.java @@ -107,7 +107,7 @@ public class Board extends Entity implements BoardInterface if (territoryAccess == null || (territoryAccess.getHostFactionId().equals(Const.FACTIONID_NONE) && territoryAccess.isDefault())) { // TODO: Listen to an event instead! - // And this is probably the place where the event should be triggered! + // NOTE: And this is probably the place where the event should be triggered! if (ConfServer.onUnclaimResetLwcLocks && LWCFeatures.getEnabled()) { LWCFeatures.clearAllChests(ps); diff --git a/src/com/massivecraft/factions/FPlayer.java b/src/com/massivecraft/factions/FPlayer.java index 04387c54..57e2edde 100644 --- a/src/com/massivecraft/factions/FPlayer.java +++ b/src/com/massivecraft/factions/FPlayer.java @@ -859,13 +859,17 @@ public class FPlayer extends SenderEntity implements EconomyParticipato LandClaimEvent claimEvent = new LandClaimEvent(flocation, forFaction, this); Bukkit.getServer().getPluginManager().callEvent(claimEvent); - if(claimEvent.isCancelled()) return false; + if (claimEvent.isCancelled()) return false; // then make 'em pay (if applicable) + // TODO: The economy integration should cancel the event above! if (mustPay && ! Econ.modifyMoney(payee, -cost, "to claim this land", "for claiming this land")) return false; + // TODO: The LWC integration should listen to Monitor for the claim event. if (LWCFeatures.getEnabled() && forFaction.isNormal() && ConfServer.onCaptureResetLwcLocks) + { LWCFeatures.clearOtherChests(flocation, this.getFaction()); + } // announce success Set informTheseFPlayers = new HashSet();