Rename FPlayers --> FPlayerColl

This commit is contained in:
Olof Larsson
2013-04-09 13:22:23 +02:00
parent e3d6a4ec8e
commit a726e1c49f
28 changed files with 89 additions and 89 deletions

View File

@ -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<i> created a new faction %s", fme.describeTo(follower, true), faction.getTag(follower));
}

View File

@ -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("<h>%s<i> changed their description to:", myFaction.describeTo(fplayer));
fplayer.sendMessage(myFaction.getDescription()); // players can inject "&" or "`" or "<i>" or whatever in their description, thus exploitable (masquerade as server messages or whatever); by the way, &k is particularly interesting looking

View File

@ -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)

View File

@ -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;

View File

@ -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;

View File

@ -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("<i>You have promoted %s<i> 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<i> gave %s<i> the leadership of %s<i>.", senderIsConsole ? "A server admin" : RelationUtil.describeThatToMe(fme, fplayer, true), newLeader.describeTo(fplayer), targetFaction.describeTo(fplayer));
}

View File

@ -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();
}

View File

@ -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();

View File

@ -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<Factions>
{
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<Factions>
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<Factions>
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<Factions>
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<Factions>
// 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();