From a726e1c49fba25d6ad78b03b80dd4a2f8e9d8bb6 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Tue, 9 Apr 2013 13:22:23 +0200 Subject: [PATCH] Rename FPlayers --> FPlayerColl --- src/com/massivecraft/factions/FPlayer.java | 2 +- .../{FPlayers.java => FPlayerColl.java} | 8 ++++---- src/com/massivecraft/factions/Faction.java | 8 ++++---- .../massivecraft/factions/FactionColl.java | 2 +- src/com/massivecraft/factions/Factions.java | 8 ++++---- .../massivecraft/factions/cmd/CmdCreate.java | 6 +++--- .../factions/cmd/CmdDescription.java | 4 ++-- .../massivecraft/factions/cmd/CmdDisband.java | 4 ++-- .../massivecraft/factions/cmd/CmdHome.java | 4 ++-- .../massivecraft/factions/cmd/CmdJoin.java | 4 ++-- .../massivecraft/factions/cmd/CmdLeader.java | 6 +++--- .../massivecraft/factions/cmd/CmdReload.java | 6 +++--- .../massivecraft/factions/cmd/CmdSaveAll.java | 4 ++-- .../massivecraft/factions/cmd/FCommand.java | 12 +++++------ .../factions/event/FactionCreateEvent.java | 4 ++-- .../factions/event/FactionDisbandEvent.java | 4 ++-- .../factions/integration/LWCFeatures.java | 4 ++-- .../factions/integration/SpoutFeatures.java | 12 +++++------ .../integration/SpoutMainListener.java | 4 ++-- .../herochat/FactionsChannelAbstract.java | 6 +++--- .../herochat/HerochatListener.java | 4 ++-- .../listeners/FactionsBlockListener.java | 4 ++-- .../listeners/FactionsChatListener.java | 12 +++++------ .../listeners/FactionsEntityListener.java | 10 +++++----- .../listeners/FactionsPlayerListener.java | 20 +++++++++---------- .../massivecraft/factions/struct/FPerm.java | 6 +++--- .../factions/struct/TerritoryAccess.java | 6 +++--- .../factions/util/AutoLeaveTask.java | 4 ++-- 28 files changed, 89 insertions(+), 89 deletions(-) rename src/com/massivecraft/factions/{FPlayers.java => FPlayerColl.java} (87%) diff --git a/src/com/massivecraft/factions/FPlayer.java b/src/com/massivecraft/factions/FPlayer.java index 321f955a..39d78613 100644 --- a/src/com/massivecraft/factions/FPlayer.java +++ b/src/com/massivecraft/factions/FPlayer.java @@ -524,7 +524,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator if (myFaction.isNormal() && !perm && myFaction.getFPlayers().isEmpty()) { // Remove this faction - for (FPlayer fplayer : FPlayers.i.getOnline()) + for (FPlayer fplayer : FPlayerColl.i.getOnline()) { fplayer.msg("%s was disbanded.", myFaction.describeTo(fplayer, true)); } diff --git a/src/com/massivecraft/factions/FPlayers.java b/src/com/massivecraft/factions/FPlayerColl.java similarity index 87% rename from src/com/massivecraft/factions/FPlayers.java rename to src/com/massivecraft/factions/FPlayerColl.java index 558ec9ff..5417d212 100644 --- a/src/com/massivecraft/factions/FPlayers.java +++ b/src/com/massivecraft/factions/FPlayerColl.java @@ -10,13 +10,13 @@ import org.bukkit.craftbukkit.libs.com.google.gson.reflect.TypeToken; import com.massivecraft.factions.struct.Rel; import com.massivecraft.factions.zcore.persist.PlayerEntityCollection; -public class FPlayers extends PlayerEntityCollection +public class FPlayerColl extends PlayerEntityCollection { - public static FPlayers i = new FPlayers(); + public static FPlayerColl i = new FPlayerColl(); Factions p = Factions.get(); - private FPlayers() + private FPlayerColl() { super ( @@ -58,7 +58,7 @@ public class FPlayers extends PlayerEntityCollection long now = System.currentTimeMillis(); double toleranceMillis = ConfServer.autoLeaveAfterDaysOfInactivity * 24 * 60 * 60 * 1000; - for (FPlayer fplayer : FPlayers.i.get()) + for (FPlayer fplayer : FPlayerColl.i.get()) { if (fplayer.isOffline() && now - fplayer.getLastLoginTime() > toleranceMillis) { diff --git a/src/com/massivecraft/factions/Faction.java b/src/com/massivecraft/factions/Faction.java index f4608451..77e8b62b 100644 --- a/src/com/massivecraft/factions/Faction.java +++ b/src/com/massivecraft/factions/Faction.java @@ -374,7 +374,7 @@ public class Faction extends Entity implements EconomyParticipator fplayers.clear(); if (this.isNone()) return; - for (FPlayer fplayer : FPlayers.i.get()) + for (FPlayer fplayer : FPlayerColl.i.get()) { if (fplayer.getFaction() == this) { @@ -454,7 +454,7 @@ public class Faction extends Entity implements EconomyParticipator for (Player player: Factions.get().getServer().getOnlinePlayers()) { - FPlayer fplayer = FPlayers.i.get(player); + FPlayer fplayer = FPlayerColl.i.get(player); if (fplayer.getFaction() == this) { ret.add(player); @@ -490,7 +490,7 @@ public class Faction extends Entity implements EconomyParticipator 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()) + for (FPlayer fplayer : FPlayerColl.i.getOnline()) { fplayer.msg("The faction %s was disbanded.", this.getTag(fplayer)); } @@ -596,6 +596,6 @@ public class Faction extends Entity implements EconomyParticipator Board.clean(); // Clean the fplayers - FPlayers.i.clean(); + FPlayerColl.i.clean(); } } diff --git a/src/com/massivecraft/factions/FactionColl.java b/src/com/massivecraft/factions/FactionColl.java index c32d4e8d..703d14c6 100644 --- a/src/com/massivecraft/factions/FactionColl.java +++ b/src/com/massivecraft/factions/FactionColl.java @@ -188,7 +188,7 @@ public class FactionColl extends EntityCollection { p.log(Level.WARNING, "Non existing factionId "+id+" requested! Issuing cleaning!"); Board.clean(); - FPlayers.i.clean(); + FPlayerColl.i.clean(); } return super.get(id); diff --git a/src/com/massivecraft/factions/Factions.java b/src/com/massivecraft/factions/Factions.java index 20ee6986..3d156703 100644 --- a/src/com/massivecraft/factions/Factions.java +++ b/src/com/massivecraft/factions/Factions.java @@ -102,7 +102,7 @@ public class Factions extends MPlugin // Load Conf from disk ConfServer.load(); - FPlayers.i.loadFromDisc(); + FPlayerColl.i.loadFromDisc(); FactionColl.i.loadFromDisc(); Board.load(); @@ -264,7 +264,7 @@ public class Factions extends MPlugin if (speaker == null) return tag; - FPlayer me = FPlayers.i.get(speaker); + FPlayer me = FPlayerColl.i.get(speaker); if (me == null) return tag; @@ -272,7 +272,7 @@ public class Factions extends MPlugin if (listener == null || !ConfServer.chatParseTagsColored) { tag = me.getChatTag().trim(); } else { - FPlayer you = FPlayers.i.get(listener); + FPlayer you = FPlayerColl.i.get(listener); if (you == null) tag = me.getChatTag().trim(); else // everything checks out, give the colored tag @@ -290,7 +290,7 @@ public class Factions extends MPlugin if (player == null) return ""; - FPlayer me = FPlayers.i.get(player); + FPlayer me = FPlayerColl.i.get(player); if (me == null) return ""; diff --git a/src/com/massivecraft/factions/cmd/CmdCreate.java b/src/com/massivecraft/factions/cmd/CmdCreate.java index 755180e4..4c6cb122 100644 --- a/src/com/massivecraft/factions/cmd/CmdCreate.java +++ b/src/com/massivecraft/factions/cmd/CmdCreate.java @@ -6,7 +6,7 @@ import org.bukkit.Bukkit; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FPlayer; -import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.FPlayerColl; import com.massivecraft.factions.Faction; import com.massivecraft.factions.FactionColl; import com.massivecraft.factions.Factions; @@ -82,7 +82,7 @@ public class CmdCreate extends FCommand faction.setTag(tag); // trigger the faction join event for the creator - FPlayerJoinEvent joinEvent = new FPlayerJoinEvent(FPlayers.i.get(me),faction,FPlayerJoinEvent.PlayerJoinReason.CREATE); + FPlayerJoinEvent joinEvent = new FPlayerJoinEvent(FPlayerColl.i.get(me),faction,FPlayerJoinEvent.PlayerJoinReason.CREATE); Bukkit.getServer().getPluginManager().callEvent(joinEvent); // join event cannot be cancelled or you'll have an empty faction @@ -90,7 +90,7 @@ public class CmdCreate extends FCommand fme.setRole(Rel.LEADER); fme.setFaction(faction); - for (FPlayer follower : FPlayers.i.getOnline()) + for (FPlayer follower : FPlayerColl.i.getOnline()) { follower.msg("%s created a new faction %s", fme.describeTo(follower, true), faction.getTag(follower)); } diff --git a/src/com/massivecraft/factions/cmd/CmdDescription.java b/src/com/massivecraft/factions/cmd/CmdDescription.java index 50aa5716..d9629403 100644 --- a/src/com/massivecraft/factions/cmd/CmdDescription.java +++ b/src/com/massivecraft/factions/cmd/CmdDescription.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FPlayer; -import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.FPlayerColl; import com.massivecraft.factions.Perm; import com.massivecraft.factions.zcore.util.TextUtil; @@ -42,7 +42,7 @@ public class CmdDescription extends FCommand } // Broadcast the description to everyone - for (FPlayer fplayer : FPlayers.i.getOnline()) + for (FPlayer fplayer : FPlayerColl.i.getOnline()) { fplayer.msg("%s changed their description to:", myFaction.describeTo(fplayer)); fplayer.sendMessage(myFaction.getDescription()); // players can inject "&" or "`" or "" or whatever in their description, thus exploitable (masquerade as server messages or whatever); by the way, &k is particularly interesting looking diff --git a/src/com/massivecraft/factions/cmd/CmdDisband.java b/src/com/massivecraft/factions/cmd/CmdDisband.java index ed9d6502..8bdc35f2 100644 --- a/src/com/massivecraft/factions/cmd/CmdDisband.java +++ b/src/com/massivecraft/factions/cmd/CmdDisband.java @@ -6,7 +6,7 @@ import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.event.FPlayerLeaveEvent; import com.massivecraft.factions.event.FactionDisbandEvent; import com.massivecraft.factions.integration.Econ; -import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.FPlayerColl; import com.massivecraft.factions.Faction; import com.massivecraft.factions.Factions; import com.massivecraft.factions.FPlayer; @@ -60,7 +60,7 @@ public class CmdDisband extends FCommand } // Inform all players - for (FPlayer fplayer : FPlayers.i.getOnline()) + for (FPlayer fplayer : FPlayerColl.i.getOnline()) { String who = senderIsConsole ? "A server admin" : fme.describeTo(fplayer); if (fplayer.getFaction() == faction) diff --git a/src/com/massivecraft/factions/cmd/CmdHome.java b/src/com/massivecraft/factions/cmd/CmdHome.java index b0758191..e9fd11c9 100644 --- a/src/com/massivecraft/factions/cmd/CmdHome.java +++ b/src/com/massivecraft/factions/cmd/CmdHome.java @@ -11,7 +11,7 @@ import com.massivecraft.factions.Board; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FLocation; import com.massivecraft.factions.FPlayer; -import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.FPlayerColl; import com.massivecraft.factions.Faction; import com.massivecraft.factions.Perm; import com.massivecraft.factions.integration.EssentialsFeatures; @@ -106,7 +106,7 @@ public class CmdHome extends FCommand if (p == null || !p.isOnline() || p.isDead() || p == me || p.getWorld() != w) continue; - FPlayer fp = FPlayers.i.get(p); + FPlayer fp = FPlayerColl.i.get(p); if (fme.getRelationTo(fp) != Rel.ENEMY) continue; diff --git a/src/com/massivecraft/factions/cmd/CmdJoin.java b/src/com/massivecraft/factions/cmd/CmdJoin.java index 34783658..392df9e4 100644 --- a/src/com/massivecraft/factions/cmd/CmdJoin.java +++ b/src/com/massivecraft/factions/cmd/CmdJoin.java @@ -4,7 +4,7 @@ import org.bukkit.Bukkit; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FPlayer; -import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.FPlayerColl; import com.massivecraft.factions.Faction; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; @@ -80,7 +80,7 @@ public class CmdJoin extends FCommand 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); + FPlayerJoinEvent joinEvent = new FPlayerJoinEvent(FPlayerColl.i.get(me),faction,FPlayerJoinEvent.PlayerJoinReason.COMMAND); Bukkit.getServer().getPluginManager().callEvent(joinEvent); if (joinEvent.isCancelled()) return; diff --git a/src/com/massivecraft/factions/cmd/CmdLeader.java b/src/com/massivecraft/factions/cmd/CmdLeader.java index 9ed94c35..199b879c 100644 --- a/src/com/massivecraft/factions/cmd/CmdLeader.java +++ b/src/com/massivecraft/factions/cmd/CmdLeader.java @@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd; import org.bukkit.Bukkit; import com.massivecraft.factions.FPlayer; -import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.FPlayerColl; import com.massivecraft.factions.Faction; import com.massivecraft.factions.Perm; import com.massivecraft.factions.event.FPlayerJoinEvent; @@ -70,7 +70,7 @@ public class CmdLeader extends FCommand // only perform a FPlayerJoinEvent when newLeader isn't actually in the faction if (newLeader.getFaction() != targetFaction) { - FPlayerJoinEvent event = new FPlayerJoinEvent(FPlayers.i.get(me),targetFaction,FPlayerJoinEvent.PlayerJoinReason.LEADER); + FPlayerJoinEvent event = new FPlayerJoinEvent(FPlayerColl.i.get(me),targetFaction,FPlayerJoinEvent.PlayerJoinReason.LEADER); Bukkit.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) return; } @@ -94,7 +94,7 @@ public class CmdLeader extends FCommand msg("You have promoted %s to the position of faction leader.", newLeader.describeTo(fme, true)); // Inform all players - for (FPlayer fplayer : FPlayers.i.getOnline()) + for (FPlayer fplayer : FPlayerColl.i.getOnline()) { fplayer.msg("%s gave %s the leadership of %s.", senderIsConsole ? "A server admin" : RelationUtil.describeThatToMe(fme, fplayer, true), newLeader.describeTo(fplayer), targetFaction.describeTo(fplayer)); } diff --git a/src/com/massivecraft/factions/cmd/CmdReload.java b/src/com/massivecraft/factions/cmd/CmdReload.java index 7f9db746..8c3d8c32 100644 --- a/src/com/massivecraft/factions/cmd/CmdReload.java +++ b/src/com/massivecraft/factions/cmd/CmdReload.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Board; import com.massivecraft.factions.ConfServer; -import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.FPlayerColl; import com.massivecraft.factions.FactionColl; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; @@ -52,14 +52,14 @@ public class CmdReload extends FCommand } else if (file.startsWith("p")) { - FPlayers.i.loadFromDisc(); + FPlayerColl.i.loadFromDisc(); fileName = "players.json"; } else if (file.startsWith("a")) { fileName = "all"; ConfServer.load(); - FPlayers.i.loadFromDisc(); + FPlayerColl.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 d1a29375..0d9c4b2f 100644 --- a/src/com/massivecraft/factions/cmd/CmdSaveAll.java +++ b/src/com/massivecraft/factions/cmd/CmdSaveAll.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Board; import com.massivecraft.factions.ConfServer; -import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.FPlayerColl; import com.massivecraft.factions.FactionColl; import com.massivecraft.factions.Perm; @@ -30,7 +30,7 @@ public class CmdSaveAll extends FCommand @Override public void perform() { - FPlayers.i.saveToDisc(); + FPlayerColl.i.saveToDisc(); FactionColl.i.saveToDisc(); Board.save(); ConfServer.save(); diff --git a/src/com/massivecraft/factions/cmd/FCommand.java b/src/com/massivecraft/factions/cmd/FCommand.java index 2b6eba26..9d647406 100644 --- a/src/com/massivecraft/factions/cmd/FCommand.java +++ b/src/com/massivecraft/factions/cmd/FCommand.java @@ -8,7 +8,7 @@ import org.bukkit.entity.Player; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.FPlayer; -import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.FPlayerColl; import com.massivecraft.factions.Faction; import com.massivecraft.factions.FactionColl; import com.massivecraft.factions.Factions; @@ -50,7 +50,7 @@ public abstract class FCommand extends MCommand { if (sender instanceof Player) { - this.fme = FPlayers.i.get((Player)sender); + this.fme = FPlayerColl.i.get((Player)sender); this.myFaction = this.fme.getFaction(); } else @@ -95,7 +95,7 @@ public abstract class FCommand extends MCommand if ( ! (sender instanceof Player)) return false; - FPlayer fplayer = FPlayers.i.get((Player)sender); + FPlayer fplayer = FPlayerColl.i.get((Player)sender); if ( ! fplayer.hasFaction()) { @@ -157,7 +157,7 @@ public abstract class FCommand extends MCommand if (name != null) { - FPlayer fplayer = FPlayers.i.get(name); + FPlayer fplayer = FPlayerColl.i.get(name); if (fplayer != null) { ret = fplayer; @@ -191,7 +191,7 @@ public abstract class FCommand extends MCommand if (name != null) { - FPlayer fplayer = FPlayers.i.getBestIdMatch(name); + FPlayer fplayer = FPlayerColl.i.getBestIdMatch(name); if (fplayer != null) { ret = fplayer; @@ -242,7 +242,7 @@ public abstract class FCommand extends MCommand // Next we match player names if (faction == null) { - FPlayer fplayer = FPlayers.i.getBestIdMatch(name); + FPlayer fplayer = FPlayerColl.i.getBestIdMatch(name); if (fplayer != null) { faction = fplayer.getFaction(); diff --git a/src/com/massivecraft/factions/event/FactionCreateEvent.java b/src/com/massivecraft/factions/event/FactionCreateEvent.java index 9bf8739e..55fab873 100644 --- a/src/com/massivecraft/factions/event/FactionCreateEvent.java +++ b/src/com/massivecraft/factions/event/FactionCreateEvent.java @@ -6,7 +6,7 @@ import org.bukkit.event.Event; import org.bukkit.event.HandlerList; import com.massivecraft.factions.FPlayer; -import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.FPlayerColl; import com.massivecraft.factions.FactionColl; public class FactionCreateEvent extends Event implements Cancellable @@ -26,7 +26,7 @@ public class FactionCreateEvent extends Event implements Cancellable public FPlayer getFPlayer() { - return FPlayers.i.get(sender); + return FPlayerColl.i.get(sender); } public String getFactionId() diff --git a/src/com/massivecraft/factions/event/FactionDisbandEvent.java b/src/com/massivecraft/factions/event/FactionDisbandEvent.java index de970cf3..f8bef414 100644 --- a/src/com/massivecraft/factions/event/FactionDisbandEvent.java +++ b/src/com/massivecraft/factions/event/FactionDisbandEvent.java @@ -6,7 +6,7 @@ import org.bukkit.event.Event; import org.bukkit.event.HandlerList; import com.massivecraft.factions.FPlayer; -import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.FPlayerColl; import com.massivecraft.factions.Faction; import com.massivecraft.factions.FactionColl; @@ -42,7 +42,7 @@ public class FactionDisbandEvent extends Event implements Cancellable public FPlayer getFPlayer() { - return FPlayers.i.get(sender); + return FPlayerColl.i.get(sender); } public Player getPlayer() diff --git a/src/com/massivecraft/factions/integration/LWCFeatures.java b/src/com/massivecraft/factions/integration/LWCFeatures.java index 2ee67fb0..9887e6a1 100644 --- a/src/com/massivecraft/factions/integration/LWCFeatures.java +++ b/src/com/massivecraft/factions/integration/LWCFeatures.java @@ -15,7 +15,7 @@ import com.griefcraft.lwc.LWC; import com.griefcraft.lwc.LWCPlugin; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FLocation; -import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.FPlayerColl; import com.massivecraft.factions.Faction; import com.massivecraft.factions.Factions; @@ -57,7 +57,7 @@ public class LWCFeatures { if(lwc.findProtection(chests.get(x)) != null) { - if(!faction.getFPlayers().contains(FPlayers.i.get(lwc.findProtection(chests.get(x)).getOwner()))) + if(!faction.getFPlayers().contains(FPlayerColl.i.get(lwc.findProtection(chests.get(x)).getOwner()))) lwc.findProtection(chests.get(x)).remove(); } } diff --git a/src/com/massivecraft/factions/integration/SpoutFeatures.java b/src/com/massivecraft/factions/integration/SpoutFeatures.java index b76abcc9..be30d191 100644 --- a/src/com/massivecraft/factions/integration/SpoutFeatures.java +++ b/src/com/massivecraft/factions/integration/SpoutFeatures.java @@ -6,7 +6,7 @@ import java.util.Set; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FPlayer; -import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.FPlayerColl; import com.massivecraft.factions.Faction; import com.massivecraft.factions.FLocation; import com.massivecraft.factions.Factions; @@ -73,7 +73,7 @@ public class SpoutFeatures for (Player player : fromPlayers) { - FPlayer fplayer = FPlayers.i.get(player); + FPlayer fplayer = FPlayerColl.i.get(player); SpoutPlayer splayer = SpoutManager.getPlayer(player); Faction faction = fplayer.getFaction(); @@ -137,13 +137,13 @@ public class SpoutFeatures for (Player player : fromPlayers) { - FPlayer fplayer = FPlayers.i.get(player); + FPlayer fplayer = FPlayerColl.i.get(player); SpoutPlayer splayer = SpoutManager.getPlayer(player); Faction faction = fplayer.getFaction(); for (Player playerTo : toPlayers) { - FPlayer fplayerTo = FPlayers.i.get(playerTo); + FPlayer fplayerTo = FPlayerColl.i.get(playerTo); SpoutPlayer splayerTo = SpoutManager.getPlayer(playerTo); Faction factionTo = fplayerTo.getFaction(); @@ -250,7 +250,7 @@ public class SpoutFeatures { if ( ! isEnabled()) return; - Set players = FPlayers.i.getOnline(); + Set players = FPlayerColl.i.getOnline(); for (FPlayer player : players) { @@ -273,7 +273,7 @@ public class SpoutFeatures { if ( ! isEnabled()) return; - Set players = FPlayers.i.getOnline(); + Set players = FPlayerColl.i.getOnline(); for (FPlayer player : players) { diff --git a/src/com/massivecraft/factions/integration/SpoutMainListener.java b/src/com/massivecraft/factions/integration/SpoutMainListener.java index 7c2c6ce0..784aa0cc 100644 --- a/src/com/massivecraft/factions/integration/SpoutMainListener.java +++ b/src/com/massivecraft/factions/integration/SpoutMainListener.java @@ -12,7 +12,7 @@ import com.massivecraft.factions.Board; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FLocation; import com.massivecraft.factions.FPlayer; -import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.FPlayerColl; import com.massivecraft.factions.Faction; import com.massivecraft.factions.Factions; import com.massivecraft.factions.struct.TerritoryAccess; @@ -29,7 +29,7 @@ public class SpoutMainListener implements Listener @EventHandler(priority = EventPriority.NORMAL) public void onSpoutCraftEnable(SpoutCraftEnableEvent event) { - final FPlayer me = FPlayers.i.get(event.getPlayer()); + final FPlayer me = FPlayerColl.i.get(event.getPlayer()); SpoutFeatures.updateTitle(me, null); SpoutFeatures.updateTitle(null, me); diff --git a/src/com/massivecraft/factions/integration/herochat/FactionsChannelAbstract.java b/src/com/massivecraft/factions/integration/herochat/FactionsChannelAbstract.java index 0730dd5e..3a255379 100644 --- a/src/com/massivecraft/factions/integration/herochat/FactionsChannelAbstract.java +++ b/src/com/massivecraft/factions/integration/herochat/FactionsChannelAbstract.java @@ -23,7 +23,7 @@ import com.dthielke.herochat.MessageFormatSupplier; import com.dthielke.herochat.MessageNotFoundException; import com.dthielke.herochat.util.Messaging; import com.massivecraft.factions.FPlayer; -import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.FPlayerColl; import com.massivecraft.factions.Faction; import com.massivecraft.factions.struct.Rel; @@ -213,11 +213,11 @@ public abstract class FactionsChannelAbstract implements Channel { Set ret = new HashSet(); - FPlayer fpsender = FPlayers.i.get(sender); + FPlayer fpsender = FPlayerColl.i.get(sender); Faction faction = fpsender.getFaction(); ret.addAll(faction.getOnlinePlayers()); - for (FPlayer fplayer : FPlayers.i.getOnline()) + for (FPlayer fplayer : FPlayerColl.i.getOnline()) { if(this.getTargetRelations().contains(faction.getRelationTo(fplayer))) { diff --git a/src/com/massivecraft/factions/integration/herochat/HerochatListener.java b/src/com/massivecraft/factions/integration/herochat/HerochatListener.java index ae3adb9e..b6c302c5 100644 --- a/src/com/massivecraft/factions/integration/herochat/HerochatListener.java +++ b/src/com/massivecraft/factions/integration/herochat/HerochatListener.java @@ -9,7 +9,7 @@ import com.dthielke.herochat.ChannelChatEvent; import com.dthielke.herochat.Herochat; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FPlayer; -import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.FPlayerColl; import com.massivecraft.factions.Factions; import com.massivecraft.factions.listeners.FactionsChatListener; @@ -34,7 +34,7 @@ public class HerochatListener implements Listener if (ConfServer.chatTagHandledByAnotherPlugin) return; Player from = event.getSender().getPlayer(); - FPlayer fpfrom = FPlayers.i.get(from); + FPlayer fpfrom = FPlayerColl.i.get(from); String format = event.getFormat(); format = format.replaceAll("&r", "§r"); diff --git a/src/com/massivecraft/factions/listeners/FactionsBlockListener.java b/src/com/massivecraft/factions/listeners/FactionsBlockListener.java index 7ae7ac01..2b75e397 100644 --- a/src/com/massivecraft/factions/listeners/FactionsBlockListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsBlockListener.java @@ -18,7 +18,7 @@ import com.massivecraft.factions.Board; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FLocation; import com.massivecraft.factions.FPlayer; -import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.FPlayerColl; import com.massivecraft.factions.Faction; import com.massivecraft.factions.Factions; import com.massivecraft.factions.struct.FFlag; @@ -66,7 +66,7 @@ public class FactionsBlockListener implements Listener String name = player.getName(); if (ConfServer.playersWhoBypassAllProtection.contains(name)) return true; - FPlayer me = FPlayers.i.get(name); + FPlayer me = FPlayerColl.i.get(name); if (me.hasAdminMode()) return true; FLocation loc = new FLocation(location); diff --git a/src/com/massivecraft/factions/listeners/FactionsChatListener.java b/src/com/massivecraft/factions/listeners/FactionsChatListener.java index 65ba2255..aed1a68f 100644 --- a/src/com/massivecraft/factions/listeners/FactionsChatListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsChatListener.java @@ -23,7 +23,7 @@ import org.bukkit.plugin.RegisteredListener; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FPlayer; -import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.FPlayerColl; import com.massivecraft.factions.Factions; import com.massivecraft.factions.struct.Rel; @@ -87,7 +87,7 @@ public class FactionsChatListener implements Listener if (ConfServer.chatTagHandledByAnotherPlugin) return; Player from = event.getPlayer(); - FPlayer fpfrom = FPlayers.i.get(from); + FPlayer fpfrom = FPlayerColl.i.get(from); String format = event.getFormat(); String message = event.getMessage(); @@ -116,7 +116,7 @@ public class FactionsChatListener implements Listener // 4. We send out the messages to each player with relation color. for (Player to : event.getRecipients()) { - FPlayer fpto = FPlayers.i.get(to); + FPlayer fpto = FPlayerColl.i.get(to); String formatWithColor = parseTags(format, from, fpfrom, to, fpto); to.sendMessage(String.format(formatWithColor, from.getDisplayName(), message)); } @@ -181,7 +181,7 @@ public class FactionsChatListener implements Listener public static String parseTags(String str, Player from) { - FPlayer fpfrom = FPlayers.i.get(from); + FPlayer fpfrom = FPlayerColl.i.get(from); return parseTags(str, from, fpfrom, null, null); } public static String parseTags(String str, Player from, FPlayer fpfrom) @@ -190,8 +190,8 @@ public class FactionsChatListener implements Listener } public static String parseTags(String str, Player from, Player to) { - FPlayer fpfrom = FPlayers.i.get(from); - FPlayer fpto = FPlayers.i.get(to); + FPlayer fpfrom = FPlayerColl.i.get(from); + FPlayer fpto = FPlayerColl.i.get(to); return parseTags(str, from, fpfrom, to, fpto); } public static String parseTags(String str, Player from, FPlayer fpfrom, Player to, FPlayer fpto) diff --git a/src/com/massivecraft/factions/listeners/FactionsEntityListener.java b/src/com/massivecraft/factions/listeners/FactionsEntityListener.java index d5e4f309..fb912be0 100644 --- a/src/com/massivecraft/factions/listeners/FactionsEntityListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsEntityListener.java @@ -42,7 +42,7 @@ import com.massivecraft.factions.Board; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FLocation; import com.massivecraft.factions.FPlayer; -import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.FPlayerColl; import com.massivecraft.factions.Faction; import com.massivecraft.factions.Factions; import com.massivecraft.factions.event.PowerLossEvent; @@ -67,7 +67,7 @@ public class FactionsEntityListener implements Listener if ( ! (entity instanceof Player)) return; Player player = (Player) entity; - FPlayer fplayer = FPlayers.i.get(player); + FPlayer fplayer = FPlayerColl.i.get(player); Faction faction = Board.getFactionAt(new FLocation(player.getLocation())); PowerLossEvent powerLossEvent = new PowerLossEvent(faction,fplayer); @@ -230,7 +230,7 @@ public class FactionsEntityListener implements Listener if ( ! (damagee instanceof Player)) return true; - FPlayer defender = FPlayers.i.get((Player)damagee); + FPlayer defender = FPlayerColl.i.get((Player)damagee); if (defender == null || defender.getPlayer() == null) return true; @@ -254,7 +254,7 @@ public class FactionsEntityListener implements Listener { if (notify) { - FPlayer attacker = FPlayers.i.get((Player)damager); + FPlayer attacker = FPlayerColl.i.get((Player)damager); attacker.msg("PVP is disabled in %s.", defLocFaction.describeTo(attacker)); } return false; @@ -265,7 +265,7 @@ public class FactionsEntityListener implements Listener if ( ! (damager instanceof Player)) return true; - FPlayer attacker = FPlayers.i.get((Player)damager); + FPlayer attacker = FPlayerColl.i.get((Player)damager); if (attacker == null || attacker.getPlayer() == null) return true; diff --git a/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java b/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java index 611d6d36..edeb4593 100644 --- a/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java @@ -28,7 +28,7 @@ import com.massivecraft.factions.Board; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FLocation; import com.massivecraft.factions.FPlayer; -import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.FPlayerColl; import com.massivecraft.factions.Factions; import com.massivecraft.factions.integration.SpoutFeatures; import com.massivecraft.factions.struct.FFlag; @@ -50,7 +50,7 @@ public class FactionsPlayerListener implements Listener public void onPlayerJoin(PlayerJoinEvent event) { // Make sure that all online players do have a fplayer. - final FPlayer me = FPlayers.i.get(event.getPlayer()); + final FPlayer me = FPlayerColl.i.get(event.getPlayer()); // Update the lastLoginTime for this fplayer me.setLastLoginTime(System.currentTimeMillis()); @@ -64,7 +64,7 @@ public class FactionsPlayerListener implements Listener @EventHandler(priority = EventPriority.NORMAL) public void onPlayerQuit(PlayerQuitEvent event) { - FPlayer me = FPlayers.i.get(event.getPlayer()); + FPlayer me = FPlayerColl.i.get(event.getPlayer()); // Make sure player's power is up to date when they log off. me.getPower(); @@ -91,7 +91,7 @@ public class FactionsPlayerListener implements Listener return; Player player = event.getPlayer(); - FPlayer me = FPlayers.i.get(player); + FPlayer me = FPlayerColl.i.get(player); // Did we change coord? FLocation from = me.getLastStoodAt(); @@ -161,7 +161,7 @@ public class FactionsPlayerListener implements Listener int count = attempt.increment(); if (count >= 10) { - FPlayer me = FPlayers.i.get(name); + FPlayer me = FPlayerColl.i.get(name); me.msg("Ouch, that is starting to hurt. You should give it a rest."); player.damage(NumberConversions.floor((double)count / 10)); } @@ -207,7 +207,7 @@ public class FactionsPlayerListener implements Listener String name = player.getName(); if (ConfServer.playersWhoBypassAllProtection.contains(name)) return true; - FPlayer me = FPlayers.i.get(name); + FPlayer me = FPlayerColl.i.get(name); if (me.hasAdminMode()) return true; if (ConfServer.materialsEditTools.contains(material) && ! FPerm.BUILD.has(me, loc, ! justCheck)) return false; return true; @@ -217,7 +217,7 @@ public class FactionsPlayerListener implements Listener String name = player.getName(); if (ConfServer.playersWhoBypassAllProtection.contains(name)) return true; - FPlayer me = FPlayers.i.get(name); + FPlayer me = FPlayerColl.i.get(name); if (me.hasAdminMode()) return true; Location loc = block.getLocation(); Material material = block.getType(); @@ -233,7 +233,7 @@ public class FactionsPlayerListener implements Listener @EventHandler(priority = EventPriority.HIGH) public void onPlayerRespawn(PlayerRespawnEvent event) { - FPlayer me = FPlayers.i.get(event.getPlayer()); + FPlayer me = FPlayerColl.i.get(event.getPlayer()); me.getPower(); // update power, so they won't have gained any while dead @@ -293,7 +293,7 @@ public class FactionsPlayerListener implements Listener { // Get the player Player player = event.getPlayer(); - FPlayer me = FPlayers.i.get(player); + FPlayer me = FPlayerColl.i.get(player); // With adminmode no commands are denied. if (me.hasAdminMode()) return; @@ -352,7 +352,7 @@ public class FactionsPlayerListener implements Listener { if (event.isCancelled()) return; - FPlayer badGuy = FPlayers.i.get(event.getPlayer()); + FPlayer badGuy = FPlayerColl.i.get(event.getPlayer()); if (badGuy == null) { return; diff --git a/src/com/massivecraft/factions/struct/FPerm.java b/src/com/massivecraft/factions/struct/FPerm.java index defac771..9033ca65 100644 --- a/src/com/massivecraft/factions/struct/FPerm.java +++ b/src/com/massivecraft/factions/struct/FPerm.java @@ -13,7 +13,7 @@ import com.massivecraft.factions.Board; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FLocation; import com.massivecraft.factions.FPlayer; -import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.FPlayerColl; import com.massivecraft.factions.Faction; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; @@ -146,7 +146,7 @@ public enum FPerm if (testSubject instanceof Player) { - rpSubject = FPlayers.i.get((Player)testSubject); + rpSubject = FPlayerColl.i.get((Player)testSubject); } else if (testSubject instanceof RelationParticipator) { @@ -191,7 +191,7 @@ public enum FPerm { FPlayer notify = null; if (testSubject instanceof Player) - notify = FPlayers.i.get((Player)testSubject); + notify = FPlayerColl.i.get((Player)testSubject); else if (testSubject instanceof FPlayer) notify = (FPlayer)testSubject; if (notify != null) diff --git a/src/com/massivecraft/factions/struct/TerritoryAccess.java b/src/com/massivecraft/factions/struct/TerritoryAccess.java index f1f7007c..65886212 100644 --- a/src/com/massivecraft/factions/struct/TerritoryAccess.java +++ b/src/com/massivecraft/factions/struct/TerritoryAccess.java @@ -22,7 +22,7 @@ import org.bukkit.craftbukkit.libs.com.google.gson.JsonParseException; import org.bukkit.craftbukkit.libs.com.google.gson.JsonPrimitive; import org.bukkit.craftbukkit.libs.com.google.gson.JsonSerializationContext; import org.bukkit.craftbukkit.libs.com.google.gson.JsonSerializer; -import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.FPlayerColl; public class TerritoryAccess implements JsonDeserializer, JsonSerializer @@ -77,7 +77,7 @@ public class TerritoryAccess implements JsonDeserializer, JsonS if (testSubject instanceof String) return hostFactionID.equals((String)testSubject); else if (testSubject instanceof Player) - return hostFactionID.equals(FPlayers.i.get((Player)testSubject).getFactionId()); + return hostFactionID.equals(FPlayerColl.i.get((Player)testSubject).getFactionId()); else if (testSubject instanceof FPlayer) return hostFactionID.equals(((FPlayer)testSubject).getFactionId()); else if (testSubject instanceof Faction) @@ -188,7 +188,7 @@ public class TerritoryAccess implements JsonDeserializer, JsonS public boolean subjectHasAccess(Object testSubject) { if (testSubject instanceof Player) - return fPlayerHasAccess(FPlayers.i.get((Player)testSubject)); + return fPlayerHasAccess(FPlayerColl.i.get((Player)testSubject)); else if (testSubject instanceof FPlayer) return fPlayerHasAccess((FPlayer)testSubject); else if (testSubject instanceof Faction) diff --git a/src/com/massivecraft/factions/util/AutoLeaveTask.java b/src/com/massivecraft/factions/util/AutoLeaveTask.java index c6558002..ad3c8ae3 100644 --- a/src/com/massivecraft/factions/util/AutoLeaveTask.java +++ b/src/com/massivecraft/factions/util/AutoLeaveTask.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.util; import com.massivecraft.factions.ConfServer; -import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.FPlayerColl; import com.massivecraft.factions.Factions; public class AutoLeaveTask implements Runnable @@ -15,7 +15,7 @@ public class AutoLeaveTask implements Runnable public void run() { - FPlayers.i.autoLeaveOnInactivityRoutine(); + FPlayerColl.i.autoLeaveOnInactivityRoutine(); // maybe setting has been changed? if so, restart task at new rate if (this.rate != ConfServer.autoLeaveRoutineRunsEveryXMinutes)