From 358186764d6975a89454b04efd8ab6ebce16f183 Mon Sep 17 00:00:00 2001 From: Brettflan Date: Thu, 13 Oct 2011 14:30:47 -0500 Subject: [PATCH] Territory owner list was not being shown to people who aren't running the Spoutcraft client, when Spout was hooked... fixed --- .../massivecraft/factions/integration/SpoutFeatures.java | 8 +++++++- .../factions/listeners/FactionsPlayerListener.java | 6 ++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/com/massivecraft/factions/integration/SpoutFeatures.java b/src/com/massivecraft/factions/integration/SpoutFeatures.java index 92804bac..8272bd70 100644 --- a/src/com/massivecraft/factions/integration/SpoutFeatures.java +++ b/src/com/massivecraft/factions/integration/SpoutFeatures.java @@ -50,12 +50,18 @@ public class SpoutFeatures } } - // If any Spout feature is enabled in conf.json, and we're successfully hooked into it + // If we're successfully hooked into Spout public static boolean enabled() { return spoutMe; } + // If Spout is available and the specified Player is running the Spoutcraft client + public static boolean availableFor(Player player) + { + return spoutMe && SpoutManager.getPlayer(player).isSpoutCraftEnabled(); + } + // update displayed current territory for specified player; returns false if unsuccessful public static boolean updateTerritoryDisplay(FPlayer player) diff --git a/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java b/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java index fa8b3328..8be12cd9 100644 --- a/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java @@ -201,6 +201,8 @@ public class FactionsPlayerListener extends PlayerListener Faction factionTo = Board.getFactionAt(to); Faction myFaction = me.getFaction(); String ownersTo = myFaction.getOwnerListString(to); + boolean spoutClient = SpoutFeatures.availableFor(player); + if (factionFrom != factionTo) { me.sendFactionHereMessage(); @@ -211,7 +213,7 @@ public class FactionsPlayerListener extends PlayerListener Conf.ownedMessageOnBorder && ( - !SpoutFeatures.enabled() + !spoutClient || !Conf.spoutTerritoryOwnersShow ) @@ -224,7 +226,7 @@ public class FactionsPlayerListener extends PlayerListener me.sendMessage(Conf.ownedLandMessage+ownersTo); } } - else if (SpoutFeatures.enabled() && Conf.spoutTerritoryOwnersShow) + else if (spoutClient && Conf.spoutTerritoryOwnersShow) { SpoutFeatures.updateOwnerList(me); }