Rename FPlayers --> FPlayerColl
This commit is contained in:
parent
e3d6a4ec8e
commit
a726e1c49f
@ -524,7 +524,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator
|
|||||||
if (myFaction.isNormal() && !perm && myFaction.getFPlayers().isEmpty())
|
if (myFaction.isNormal() && !perm && myFaction.getFPlayers().isEmpty())
|
||||||
{
|
{
|
||||||
// Remove this faction
|
// Remove this faction
|
||||||
for (FPlayer fplayer : FPlayers.i.getOnline())
|
for (FPlayer fplayer : FPlayerColl.i.getOnline())
|
||||||
{
|
{
|
||||||
fplayer.msg("<i>%s<i> was disbanded.", myFaction.describeTo(fplayer, true));
|
fplayer.msg("<i>%s<i> was disbanded.", myFaction.describeTo(fplayer, true));
|
||||||
}
|
}
|
||||||
|
@ -10,13 +10,13 @@ import org.bukkit.craftbukkit.libs.com.google.gson.reflect.TypeToken;
|
|||||||
import com.massivecraft.factions.struct.Rel;
|
import com.massivecraft.factions.struct.Rel;
|
||||||
import com.massivecraft.factions.zcore.persist.PlayerEntityCollection;
|
import com.massivecraft.factions.zcore.persist.PlayerEntityCollection;
|
||||||
|
|
||||||
public class FPlayers extends PlayerEntityCollection<FPlayer>
|
public class FPlayerColl extends PlayerEntityCollection<FPlayer>
|
||||||
{
|
{
|
||||||
public static FPlayers i = new FPlayers();
|
public static FPlayerColl i = new FPlayerColl();
|
||||||
|
|
||||||
Factions p = Factions.get();
|
Factions p = Factions.get();
|
||||||
|
|
||||||
private FPlayers()
|
private FPlayerColl()
|
||||||
{
|
{
|
||||||
super
|
super
|
||||||
(
|
(
|
||||||
@ -58,7 +58,7 @@ public class FPlayers extends PlayerEntityCollection<FPlayer>
|
|||||||
long now = System.currentTimeMillis();
|
long now = System.currentTimeMillis();
|
||||||
double toleranceMillis = ConfServer.autoLeaveAfterDaysOfInactivity * 24 * 60 * 60 * 1000;
|
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)
|
if (fplayer.isOffline() && now - fplayer.getLastLoginTime() > toleranceMillis)
|
||||||
{
|
{
|
@ -374,7 +374,7 @@ public class Faction extends Entity implements EconomyParticipator
|
|||||||
fplayers.clear();
|
fplayers.clear();
|
||||||
if (this.isNone()) return;
|
if (this.isNone()) return;
|
||||||
|
|
||||||
for (FPlayer fplayer : FPlayers.i.get())
|
for (FPlayer fplayer : FPlayerColl.i.get())
|
||||||
{
|
{
|
||||||
if (fplayer.getFaction() == this)
|
if (fplayer.getFaction() == this)
|
||||||
{
|
{
|
||||||
@ -454,7 +454,7 @@ public class Faction extends Entity implements EconomyParticipator
|
|||||||
|
|
||||||
for (Player player: Factions.get().getServer().getOnlinePlayers())
|
for (Player player: Factions.get().getServer().getOnlinePlayers())
|
||||||
{
|
{
|
||||||
FPlayer fplayer = FPlayers.i.get(player);
|
FPlayer fplayer = FPlayerColl.i.get(player);
|
||||||
if (fplayer.getFaction() == this)
|
if (fplayer.getFaction() == this)
|
||||||
{
|
{
|
||||||
ret.add(player);
|
ret.add(player);
|
||||||
@ -490,7 +490,7 @@ public class Faction extends Entity implements EconomyParticipator
|
|||||||
if (ConfServer.logFactionDisband)
|
if (ConfServer.logFactionDisband)
|
||||||
Factions.get().log("The faction "+this.getTag()+" ("+this.getId()+") has been disbanded since it has no members left.");
|
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<i> was disbanded.", this.getTag(fplayer));
|
fplayer.msg("The faction %s<i> was disbanded.", this.getTag(fplayer));
|
||||||
}
|
}
|
||||||
@ -596,6 +596,6 @@ public class Faction extends Entity implements EconomyParticipator
|
|||||||
Board.clean();
|
Board.clean();
|
||||||
|
|
||||||
// Clean the fplayers
|
// Clean the fplayers
|
||||||
FPlayers.i.clean();
|
FPlayerColl.i.clean();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -188,7 +188,7 @@ public class FactionColl extends EntityCollection<Faction>
|
|||||||
{
|
{
|
||||||
p.log(Level.WARNING, "Non existing factionId "+id+" requested! Issuing cleaning!");
|
p.log(Level.WARNING, "Non existing factionId "+id+" requested! Issuing cleaning!");
|
||||||
Board.clean();
|
Board.clean();
|
||||||
FPlayers.i.clean();
|
FPlayerColl.i.clean();
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.get(id);
|
return super.get(id);
|
||||||
|
@ -102,7 +102,7 @@ public class Factions extends MPlugin
|
|||||||
|
|
||||||
// Load Conf from disk
|
// Load Conf from disk
|
||||||
ConfServer.load();
|
ConfServer.load();
|
||||||
FPlayers.i.loadFromDisc();
|
FPlayerColl.i.loadFromDisc();
|
||||||
FactionColl.i.loadFromDisc();
|
FactionColl.i.loadFromDisc();
|
||||||
Board.load();
|
Board.load();
|
||||||
|
|
||||||
@ -264,7 +264,7 @@ public class Factions extends MPlugin
|
|||||||
if (speaker == null)
|
if (speaker == null)
|
||||||
return tag;
|
return tag;
|
||||||
|
|
||||||
FPlayer me = FPlayers.i.get(speaker);
|
FPlayer me = FPlayerColl.i.get(speaker);
|
||||||
if (me == null)
|
if (me == null)
|
||||||
return tag;
|
return tag;
|
||||||
|
|
||||||
@ -272,7 +272,7 @@ public class Factions extends MPlugin
|
|||||||
if (listener == null || !ConfServer.chatParseTagsColored) {
|
if (listener == null || !ConfServer.chatParseTagsColored) {
|
||||||
tag = me.getChatTag().trim();
|
tag = me.getChatTag().trim();
|
||||||
} else {
|
} else {
|
||||||
FPlayer you = FPlayers.i.get(listener);
|
FPlayer you = FPlayerColl.i.get(listener);
|
||||||
if (you == null)
|
if (you == null)
|
||||||
tag = me.getChatTag().trim();
|
tag = me.getChatTag().trim();
|
||||||
else // everything checks out, give the colored tag
|
else // everything checks out, give the colored tag
|
||||||
@ -290,7 +290,7 @@ public class Factions extends MPlugin
|
|||||||
if (player == null)
|
if (player == null)
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
FPlayer me = FPlayers.i.get(player);
|
FPlayer me = FPlayerColl.i.get(player);
|
||||||
if (me == null)
|
if (me == null)
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import org.bukkit.Bukkit;
|
|||||||
|
|
||||||
import com.massivecraft.factions.ConfServer;
|
import com.massivecraft.factions.ConfServer;
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayerColl;
|
||||||
import com.massivecraft.factions.Faction;
|
import com.massivecraft.factions.Faction;
|
||||||
import com.massivecraft.factions.FactionColl;
|
import com.massivecraft.factions.FactionColl;
|
||||||
import com.massivecraft.factions.Factions;
|
import com.massivecraft.factions.Factions;
|
||||||
@ -82,7 +82,7 @@ public class CmdCreate extends FCommand
|
|||||||
faction.setTag(tag);
|
faction.setTag(tag);
|
||||||
|
|
||||||
// trigger the faction join event for the creator
|
// 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);
|
Bukkit.getServer().getPluginManager().callEvent(joinEvent);
|
||||||
// join event cannot be cancelled or you'll have an empty faction
|
// 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.setRole(Rel.LEADER);
|
||||||
fme.setFaction(faction);
|
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));
|
follower.msg("%s<i> created a new faction %s", fme.describeTo(follower, true), faction.getTag(follower));
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
|
|||||||
|
|
||||||
import com.massivecraft.factions.ConfServer;
|
import com.massivecraft.factions.ConfServer;
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayerColl;
|
||||||
import com.massivecraft.factions.Perm;
|
import com.massivecraft.factions.Perm;
|
||||||
import com.massivecraft.factions.zcore.util.TextUtil;
|
import com.massivecraft.factions.zcore.util.TextUtil;
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ public class CmdDescription extends FCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Broadcast the description to everyone
|
// 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.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
|
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
|
||||||
|
@ -6,7 +6,7 @@ import com.massivecraft.factions.ConfServer;
|
|||||||
import com.massivecraft.factions.event.FPlayerLeaveEvent;
|
import com.massivecraft.factions.event.FPlayerLeaveEvent;
|
||||||
import com.massivecraft.factions.event.FactionDisbandEvent;
|
import com.massivecraft.factions.event.FactionDisbandEvent;
|
||||||
import com.massivecraft.factions.integration.Econ;
|
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.Faction;
|
||||||
import com.massivecraft.factions.Factions;
|
import com.massivecraft.factions.Factions;
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
@ -60,7 +60,7 @@ public class CmdDisband extends FCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Inform all players
|
// Inform all players
|
||||||
for (FPlayer fplayer : FPlayers.i.getOnline())
|
for (FPlayer fplayer : FPlayerColl.i.getOnline())
|
||||||
{
|
{
|
||||||
String who = senderIsConsole ? "A server admin" : fme.describeTo(fplayer);
|
String who = senderIsConsole ? "A server admin" : fme.describeTo(fplayer);
|
||||||
if (fplayer.getFaction() == faction)
|
if (fplayer.getFaction() == faction)
|
||||||
|
@ -11,7 +11,7 @@ import com.massivecraft.factions.Board;
|
|||||||
import com.massivecraft.factions.ConfServer;
|
import com.massivecraft.factions.ConfServer;
|
||||||
import com.massivecraft.factions.FLocation;
|
import com.massivecraft.factions.FLocation;
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayerColl;
|
||||||
import com.massivecraft.factions.Faction;
|
import com.massivecraft.factions.Faction;
|
||||||
import com.massivecraft.factions.Perm;
|
import com.massivecraft.factions.Perm;
|
||||||
import com.massivecraft.factions.integration.EssentialsFeatures;
|
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)
|
if (p == null || !p.isOnline() || p.isDead() || p == me || p.getWorld() != w)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
FPlayer fp = FPlayers.i.get(p);
|
FPlayer fp = FPlayerColl.i.get(p);
|
||||||
if (fme.getRelationTo(fp) != Rel.ENEMY)
|
if (fme.getRelationTo(fp) != Rel.ENEMY)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import org.bukkit.Bukkit;
|
|||||||
|
|
||||||
import com.massivecraft.factions.ConfServer;
|
import com.massivecraft.factions.ConfServer;
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayerColl;
|
||||||
import com.massivecraft.factions.Faction;
|
import com.massivecraft.factions.Faction;
|
||||||
import com.massivecraft.factions.Factions;
|
import com.massivecraft.factions.Factions;
|
||||||
import com.massivecraft.factions.Perm;
|
import com.massivecraft.factions.Perm;
|
||||||
@ -80,7 +80,7 @@ public class CmdJoin extends FCommand
|
|||||||
if (samePlayer && ! canAffordCommand(ConfServer.econCostJoin, "to join a faction")) return;
|
if (samePlayer && ! canAffordCommand(ConfServer.econCostJoin, "to join a faction")) return;
|
||||||
|
|
||||||
// trigger the join event (cancellable)
|
// 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);
|
Bukkit.getServer().getPluginManager().callEvent(joinEvent);
|
||||||
if (joinEvent.isCancelled()) return;
|
if (joinEvent.isCancelled()) return;
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayerColl;
|
||||||
import com.massivecraft.factions.Faction;
|
import com.massivecraft.factions.Faction;
|
||||||
import com.massivecraft.factions.Perm;
|
import com.massivecraft.factions.Perm;
|
||||||
import com.massivecraft.factions.event.FPlayerJoinEvent;
|
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
|
// only perform a FPlayerJoinEvent when newLeader isn't actually in the faction
|
||||||
if (newLeader.getFaction() != targetFaction)
|
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);
|
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||||
if (event.isCancelled()) return;
|
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));
|
msg("<i>You have promoted %s<i> to the position of faction leader.", newLeader.describeTo(fme, true));
|
||||||
|
|
||||||
// Inform all players
|
// 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));
|
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));
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
|
|||||||
|
|
||||||
import com.massivecraft.factions.Board;
|
import com.massivecraft.factions.Board;
|
||||||
import com.massivecraft.factions.ConfServer;
|
import com.massivecraft.factions.ConfServer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayerColl;
|
||||||
import com.massivecraft.factions.FactionColl;
|
import com.massivecraft.factions.FactionColl;
|
||||||
import com.massivecraft.factions.Factions;
|
import com.massivecraft.factions.Factions;
|
||||||
import com.massivecraft.factions.Perm;
|
import com.massivecraft.factions.Perm;
|
||||||
@ -52,14 +52,14 @@ public class CmdReload extends FCommand
|
|||||||
}
|
}
|
||||||
else if (file.startsWith("p"))
|
else if (file.startsWith("p"))
|
||||||
{
|
{
|
||||||
FPlayers.i.loadFromDisc();
|
FPlayerColl.i.loadFromDisc();
|
||||||
fileName = "players.json";
|
fileName = "players.json";
|
||||||
}
|
}
|
||||||
else if (file.startsWith("a"))
|
else if (file.startsWith("a"))
|
||||||
{
|
{
|
||||||
fileName = "all";
|
fileName = "all";
|
||||||
ConfServer.load();
|
ConfServer.load();
|
||||||
FPlayers.i.loadFromDisc();
|
FPlayerColl.i.loadFromDisc();
|
||||||
FactionColl.i.loadFromDisc();
|
FactionColl.i.loadFromDisc();
|
||||||
Board.load();
|
Board.load();
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd;
|
|||||||
|
|
||||||
import com.massivecraft.factions.Board;
|
import com.massivecraft.factions.Board;
|
||||||
import com.massivecraft.factions.ConfServer;
|
import com.massivecraft.factions.ConfServer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayerColl;
|
||||||
import com.massivecraft.factions.FactionColl;
|
import com.massivecraft.factions.FactionColl;
|
||||||
import com.massivecraft.factions.Perm;
|
import com.massivecraft.factions.Perm;
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ public class CmdSaveAll extends FCommand
|
|||||||
@Override
|
@Override
|
||||||
public void perform()
|
public void perform()
|
||||||
{
|
{
|
||||||
FPlayers.i.saveToDisc();
|
FPlayerColl.i.saveToDisc();
|
||||||
FactionColl.i.saveToDisc();
|
FactionColl.i.saveToDisc();
|
||||||
Board.save();
|
Board.save();
|
||||||
ConfServer.save();
|
ConfServer.save();
|
||||||
|
@ -8,7 +8,7 @@ import org.bukkit.entity.Player;
|
|||||||
import com.massivecraft.factions.ConfServer;
|
import com.massivecraft.factions.ConfServer;
|
||||||
import com.massivecraft.factions.integration.Econ;
|
import com.massivecraft.factions.integration.Econ;
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayerColl;
|
||||||
import com.massivecraft.factions.Faction;
|
import com.massivecraft.factions.Faction;
|
||||||
import com.massivecraft.factions.FactionColl;
|
import com.massivecraft.factions.FactionColl;
|
||||||
import com.massivecraft.factions.Factions;
|
import com.massivecraft.factions.Factions;
|
||||||
@ -50,7 +50,7 @@ public abstract class FCommand extends MCommand<Factions>
|
|||||||
{
|
{
|
||||||
if (sender instanceof Player)
|
if (sender instanceof Player)
|
||||||
{
|
{
|
||||||
this.fme = FPlayers.i.get((Player)sender);
|
this.fme = FPlayerColl.i.get((Player)sender);
|
||||||
this.myFaction = this.fme.getFaction();
|
this.myFaction = this.fme.getFaction();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -95,7 +95,7 @@ public abstract class FCommand extends MCommand<Factions>
|
|||||||
|
|
||||||
if ( ! (sender instanceof Player)) return false;
|
if ( ! (sender instanceof Player)) return false;
|
||||||
|
|
||||||
FPlayer fplayer = FPlayers.i.get((Player)sender);
|
FPlayer fplayer = FPlayerColl.i.get((Player)sender);
|
||||||
|
|
||||||
if ( ! fplayer.hasFaction())
|
if ( ! fplayer.hasFaction())
|
||||||
{
|
{
|
||||||
@ -157,7 +157,7 @@ public abstract class FCommand extends MCommand<Factions>
|
|||||||
|
|
||||||
if (name != null)
|
if (name != null)
|
||||||
{
|
{
|
||||||
FPlayer fplayer = FPlayers.i.get(name);
|
FPlayer fplayer = FPlayerColl.i.get(name);
|
||||||
if (fplayer != null)
|
if (fplayer != null)
|
||||||
{
|
{
|
||||||
ret = fplayer;
|
ret = fplayer;
|
||||||
@ -191,7 +191,7 @@ public abstract class FCommand extends MCommand<Factions>
|
|||||||
|
|
||||||
if (name != null)
|
if (name != null)
|
||||||
{
|
{
|
||||||
FPlayer fplayer = FPlayers.i.getBestIdMatch(name);
|
FPlayer fplayer = FPlayerColl.i.getBestIdMatch(name);
|
||||||
if (fplayer != null)
|
if (fplayer != null)
|
||||||
{
|
{
|
||||||
ret = fplayer;
|
ret = fplayer;
|
||||||
@ -242,7 +242,7 @@ public abstract class FCommand extends MCommand<Factions>
|
|||||||
// Next we match player names
|
// Next we match player names
|
||||||
if (faction == null)
|
if (faction == null)
|
||||||
{
|
{
|
||||||
FPlayer fplayer = FPlayers.i.getBestIdMatch(name);
|
FPlayer fplayer = FPlayerColl.i.getBestIdMatch(name);
|
||||||
if (fplayer != null)
|
if (fplayer != null)
|
||||||
{
|
{
|
||||||
faction = fplayer.getFaction();
|
faction = fplayer.getFaction();
|
||||||
|
@ -6,7 +6,7 @@ import org.bukkit.event.Event;
|
|||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayerColl;
|
||||||
import com.massivecraft.factions.FactionColl;
|
import com.massivecraft.factions.FactionColl;
|
||||||
|
|
||||||
public class FactionCreateEvent extends Event implements Cancellable
|
public class FactionCreateEvent extends Event implements Cancellable
|
||||||
@ -26,7 +26,7 @@ public class FactionCreateEvent extends Event implements Cancellable
|
|||||||
|
|
||||||
public FPlayer getFPlayer()
|
public FPlayer getFPlayer()
|
||||||
{
|
{
|
||||||
return FPlayers.i.get(sender);
|
return FPlayerColl.i.get(sender);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFactionId()
|
public String getFactionId()
|
||||||
|
@ -6,7 +6,7 @@ import org.bukkit.event.Event;
|
|||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayerColl;
|
||||||
import com.massivecraft.factions.Faction;
|
import com.massivecraft.factions.Faction;
|
||||||
import com.massivecraft.factions.FactionColl;
|
import com.massivecraft.factions.FactionColl;
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ public class FactionDisbandEvent extends Event implements Cancellable
|
|||||||
|
|
||||||
public FPlayer getFPlayer()
|
public FPlayer getFPlayer()
|
||||||
{
|
{
|
||||||
return FPlayers.i.get(sender);
|
return FPlayerColl.i.get(sender);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Player getPlayer()
|
public Player getPlayer()
|
||||||
|
@ -15,7 +15,7 @@ import com.griefcraft.lwc.LWC;
|
|||||||
import com.griefcraft.lwc.LWCPlugin;
|
import com.griefcraft.lwc.LWCPlugin;
|
||||||
import com.massivecraft.factions.ConfServer;
|
import com.massivecraft.factions.ConfServer;
|
||||||
import com.massivecraft.factions.FLocation;
|
import com.massivecraft.factions.FLocation;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayerColl;
|
||||||
import com.massivecraft.factions.Faction;
|
import com.massivecraft.factions.Faction;
|
||||||
import com.massivecraft.factions.Factions;
|
import com.massivecraft.factions.Factions;
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ public class LWCFeatures
|
|||||||
{
|
{
|
||||||
if(lwc.findProtection(chests.get(x)) != null)
|
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();
|
lwc.findProtection(chests.get(x)).remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import java.util.Set;
|
|||||||
|
|
||||||
import com.massivecraft.factions.ConfServer;
|
import com.massivecraft.factions.ConfServer;
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayerColl;
|
||||||
import com.massivecraft.factions.Faction;
|
import com.massivecraft.factions.Faction;
|
||||||
import com.massivecraft.factions.FLocation;
|
import com.massivecraft.factions.FLocation;
|
||||||
import com.massivecraft.factions.Factions;
|
import com.massivecraft.factions.Factions;
|
||||||
@ -73,7 +73,7 @@ public class SpoutFeatures
|
|||||||
|
|
||||||
for (Player player : fromPlayers)
|
for (Player player : fromPlayers)
|
||||||
{
|
{
|
||||||
FPlayer fplayer = FPlayers.i.get(player);
|
FPlayer fplayer = FPlayerColl.i.get(player);
|
||||||
SpoutPlayer splayer = SpoutManager.getPlayer(player);
|
SpoutPlayer splayer = SpoutManager.getPlayer(player);
|
||||||
Faction faction = fplayer.getFaction();
|
Faction faction = fplayer.getFaction();
|
||||||
|
|
||||||
@ -137,13 +137,13 @@ public class SpoutFeatures
|
|||||||
|
|
||||||
for (Player player : fromPlayers)
|
for (Player player : fromPlayers)
|
||||||
{
|
{
|
||||||
FPlayer fplayer = FPlayers.i.get(player);
|
FPlayer fplayer = FPlayerColl.i.get(player);
|
||||||
SpoutPlayer splayer = SpoutManager.getPlayer(player);
|
SpoutPlayer splayer = SpoutManager.getPlayer(player);
|
||||||
Faction faction = fplayer.getFaction();
|
Faction faction = fplayer.getFaction();
|
||||||
|
|
||||||
for (Player playerTo : toPlayers)
|
for (Player playerTo : toPlayers)
|
||||||
{
|
{
|
||||||
FPlayer fplayerTo = FPlayers.i.get(playerTo);
|
FPlayer fplayerTo = FPlayerColl.i.get(playerTo);
|
||||||
SpoutPlayer splayerTo = SpoutManager.getPlayer(playerTo);
|
SpoutPlayer splayerTo = SpoutManager.getPlayer(playerTo);
|
||||||
Faction factionTo = fplayerTo.getFaction();
|
Faction factionTo = fplayerTo.getFaction();
|
||||||
|
|
||||||
@ -250,7 +250,7 @@ public class SpoutFeatures
|
|||||||
{
|
{
|
||||||
if ( ! isEnabled()) return;
|
if ( ! isEnabled()) return;
|
||||||
|
|
||||||
Set<FPlayer> players = FPlayers.i.getOnline();
|
Set<FPlayer> players = FPlayerColl.i.getOnline();
|
||||||
|
|
||||||
for (FPlayer player : players)
|
for (FPlayer player : players)
|
||||||
{
|
{
|
||||||
@ -273,7 +273,7 @@ public class SpoutFeatures
|
|||||||
{
|
{
|
||||||
if ( ! isEnabled()) return;
|
if ( ! isEnabled()) return;
|
||||||
|
|
||||||
Set<FPlayer> players = FPlayers.i.getOnline();
|
Set<FPlayer> players = FPlayerColl.i.getOnline();
|
||||||
|
|
||||||
for (FPlayer player : players)
|
for (FPlayer player : players)
|
||||||
{
|
{
|
||||||
|
@ -12,7 +12,7 @@ import com.massivecraft.factions.Board;
|
|||||||
import com.massivecraft.factions.ConfServer;
|
import com.massivecraft.factions.ConfServer;
|
||||||
import com.massivecraft.factions.FLocation;
|
import com.massivecraft.factions.FLocation;
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayerColl;
|
||||||
import com.massivecraft.factions.Faction;
|
import com.massivecraft.factions.Faction;
|
||||||
import com.massivecraft.factions.Factions;
|
import com.massivecraft.factions.Factions;
|
||||||
import com.massivecraft.factions.struct.TerritoryAccess;
|
import com.massivecraft.factions.struct.TerritoryAccess;
|
||||||
@ -29,7 +29,7 @@ public class SpoutMainListener implements Listener
|
|||||||
@EventHandler(priority = EventPriority.NORMAL)
|
@EventHandler(priority = EventPriority.NORMAL)
|
||||||
public void onSpoutCraftEnable(SpoutCraftEnableEvent event)
|
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(me, null);
|
||||||
SpoutFeatures.updateTitle(null, me);
|
SpoutFeatures.updateTitle(null, me);
|
||||||
|
@ -23,7 +23,7 @@ import com.dthielke.herochat.MessageFormatSupplier;
|
|||||||
import com.dthielke.herochat.MessageNotFoundException;
|
import com.dthielke.herochat.MessageNotFoundException;
|
||||||
import com.dthielke.herochat.util.Messaging;
|
import com.dthielke.herochat.util.Messaging;
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayerColl;
|
||||||
import com.massivecraft.factions.Faction;
|
import com.massivecraft.factions.Faction;
|
||||||
import com.massivecraft.factions.struct.Rel;
|
import com.massivecraft.factions.struct.Rel;
|
||||||
|
|
||||||
@ -213,11 +213,11 @@ public abstract class FactionsChannelAbstract implements Channel
|
|||||||
{
|
{
|
||||||
Set<Player> ret = new HashSet<Player>();
|
Set<Player> ret = new HashSet<Player>();
|
||||||
|
|
||||||
FPlayer fpsender = FPlayers.i.get(sender);
|
FPlayer fpsender = FPlayerColl.i.get(sender);
|
||||||
Faction faction = fpsender.getFaction();
|
Faction faction = fpsender.getFaction();
|
||||||
ret.addAll(faction.getOnlinePlayers());
|
ret.addAll(faction.getOnlinePlayers());
|
||||||
|
|
||||||
for (FPlayer fplayer : FPlayers.i.getOnline())
|
for (FPlayer fplayer : FPlayerColl.i.getOnline())
|
||||||
{
|
{
|
||||||
if(this.getTargetRelations().contains(faction.getRelationTo(fplayer)))
|
if(this.getTargetRelations().contains(faction.getRelationTo(fplayer)))
|
||||||
{
|
{
|
||||||
|
@ -9,7 +9,7 @@ import com.dthielke.herochat.ChannelChatEvent;
|
|||||||
import com.dthielke.herochat.Herochat;
|
import com.dthielke.herochat.Herochat;
|
||||||
import com.massivecraft.factions.ConfServer;
|
import com.massivecraft.factions.ConfServer;
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayerColl;
|
||||||
import com.massivecraft.factions.Factions;
|
import com.massivecraft.factions.Factions;
|
||||||
import com.massivecraft.factions.listeners.FactionsChatListener;
|
import com.massivecraft.factions.listeners.FactionsChatListener;
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ public class HerochatListener implements Listener
|
|||||||
if (ConfServer.chatTagHandledByAnotherPlugin) return;
|
if (ConfServer.chatTagHandledByAnotherPlugin) return;
|
||||||
|
|
||||||
Player from = event.getSender().getPlayer();
|
Player from = event.getSender().getPlayer();
|
||||||
FPlayer fpfrom = FPlayers.i.get(from);
|
FPlayer fpfrom = FPlayerColl.i.get(from);
|
||||||
String format = event.getFormat();
|
String format = event.getFormat();
|
||||||
|
|
||||||
format = format.replaceAll("&r", "§r");
|
format = format.replaceAll("&r", "§r");
|
||||||
|
@ -18,7 +18,7 @@ import com.massivecraft.factions.Board;
|
|||||||
import com.massivecraft.factions.ConfServer;
|
import com.massivecraft.factions.ConfServer;
|
||||||
import com.massivecraft.factions.FLocation;
|
import com.massivecraft.factions.FLocation;
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayerColl;
|
||||||
import com.massivecraft.factions.Faction;
|
import com.massivecraft.factions.Faction;
|
||||||
import com.massivecraft.factions.Factions;
|
import com.massivecraft.factions.Factions;
|
||||||
import com.massivecraft.factions.struct.FFlag;
|
import com.massivecraft.factions.struct.FFlag;
|
||||||
@ -66,7 +66,7 @@ public class FactionsBlockListener implements Listener
|
|||||||
String name = player.getName();
|
String name = player.getName();
|
||||||
if (ConfServer.playersWhoBypassAllProtection.contains(name)) return true;
|
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 (me.hasAdminMode()) return true;
|
||||||
|
|
||||||
FLocation loc = new FLocation(location);
|
FLocation loc = new FLocation(location);
|
||||||
|
@ -23,7 +23,7 @@ import org.bukkit.plugin.RegisteredListener;
|
|||||||
|
|
||||||
import com.massivecraft.factions.ConfServer;
|
import com.massivecraft.factions.ConfServer;
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayerColl;
|
||||||
import com.massivecraft.factions.Factions;
|
import com.massivecraft.factions.Factions;
|
||||||
import com.massivecraft.factions.struct.Rel;
|
import com.massivecraft.factions.struct.Rel;
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ public class FactionsChatListener implements Listener
|
|||||||
if (ConfServer.chatTagHandledByAnotherPlugin) return;
|
if (ConfServer.chatTagHandledByAnotherPlugin) return;
|
||||||
|
|
||||||
Player from = event.getPlayer();
|
Player from = event.getPlayer();
|
||||||
FPlayer fpfrom = FPlayers.i.get(from);
|
FPlayer fpfrom = FPlayerColl.i.get(from);
|
||||||
String format = event.getFormat();
|
String format = event.getFormat();
|
||||||
String message = event.getMessage();
|
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.
|
// 4. We send out the messages to each player with relation color.
|
||||||
for (Player to : event.getRecipients())
|
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);
|
String formatWithColor = parseTags(format, from, fpfrom, to, fpto);
|
||||||
to.sendMessage(String.format(formatWithColor, from.getDisplayName(), message));
|
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)
|
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);
|
return parseTags(str, from, fpfrom, null, null);
|
||||||
}
|
}
|
||||||
public static String parseTags(String str, Player from, FPlayer fpfrom)
|
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)
|
public static String parseTags(String str, Player from, Player to)
|
||||||
{
|
{
|
||||||
FPlayer fpfrom = FPlayers.i.get(from);
|
FPlayer fpfrom = FPlayerColl.i.get(from);
|
||||||
FPlayer fpto = FPlayers.i.get(to);
|
FPlayer fpto = FPlayerColl.i.get(to);
|
||||||
return parseTags(str, from, fpfrom, to, fpto);
|
return parseTags(str, from, fpfrom, to, fpto);
|
||||||
}
|
}
|
||||||
public static String parseTags(String str, Player from, FPlayer fpfrom, Player to, FPlayer fpto)
|
public static String parseTags(String str, Player from, FPlayer fpfrom, Player to, FPlayer fpto)
|
||||||
|
@ -42,7 +42,7 @@ import com.massivecraft.factions.Board;
|
|||||||
import com.massivecraft.factions.ConfServer;
|
import com.massivecraft.factions.ConfServer;
|
||||||
import com.massivecraft.factions.FLocation;
|
import com.massivecraft.factions.FLocation;
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayerColl;
|
||||||
import com.massivecraft.factions.Faction;
|
import com.massivecraft.factions.Faction;
|
||||||
import com.massivecraft.factions.Factions;
|
import com.massivecraft.factions.Factions;
|
||||||
import com.massivecraft.factions.event.PowerLossEvent;
|
import com.massivecraft.factions.event.PowerLossEvent;
|
||||||
@ -67,7 +67,7 @@ public class FactionsEntityListener implements Listener
|
|||||||
if ( ! (entity instanceof Player)) return;
|
if ( ! (entity instanceof Player)) return;
|
||||||
|
|
||||||
Player player = (Player) entity;
|
Player player = (Player) entity;
|
||||||
FPlayer fplayer = FPlayers.i.get(player);
|
FPlayer fplayer = FPlayerColl.i.get(player);
|
||||||
Faction faction = Board.getFactionAt(new FLocation(player.getLocation()));
|
Faction faction = Board.getFactionAt(new FLocation(player.getLocation()));
|
||||||
|
|
||||||
PowerLossEvent powerLossEvent = new PowerLossEvent(faction,fplayer);
|
PowerLossEvent powerLossEvent = new PowerLossEvent(faction,fplayer);
|
||||||
@ -230,7 +230,7 @@ public class FactionsEntityListener implements Listener
|
|||||||
|
|
||||||
if ( ! (damagee instanceof Player)) return true;
|
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)
|
if (defender == null || defender.getPlayer() == null)
|
||||||
return true;
|
return true;
|
||||||
@ -254,7 +254,7 @@ public class FactionsEntityListener implements Listener
|
|||||||
{
|
{
|
||||||
if (notify)
|
if (notify)
|
||||||
{
|
{
|
||||||
FPlayer attacker = FPlayers.i.get((Player)damager);
|
FPlayer attacker = FPlayerColl.i.get((Player)damager);
|
||||||
attacker.msg("<i>PVP is disabled in %s.", defLocFaction.describeTo(attacker));
|
attacker.msg("<i>PVP is disabled in %s.", defLocFaction.describeTo(attacker));
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -265,7 +265,7 @@ public class FactionsEntityListener implements Listener
|
|||||||
if ( ! (damager instanceof Player))
|
if ( ! (damager instanceof Player))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
FPlayer attacker = FPlayers.i.get((Player)damager);
|
FPlayer attacker = FPlayerColl.i.get((Player)damager);
|
||||||
|
|
||||||
if (attacker == null || attacker.getPlayer() == null)
|
if (attacker == null || attacker.getPlayer() == null)
|
||||||
return true;
|
return true;
|
||||||
|
@ -28,7 +28,7 @@ import com.massivecraft.factions.Board;
|
|||||||
import com.massivecraft.factions.ConfServer;
|
import com.massivecraft.factions.ConfServer;
|
||||||
import com.massivecraft.factions.FLocation;
|
import com.massivecraft.factions.FLocation;
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayerColl;
|
||||||
import com.massivecraft.factions.Factions;
|
import com.massivecraft.factions.Factions;
|
||||||
import com.massivecraft.factions.integration.SpoutFeatures;
|
import com.massivecraft.factions.integration.SpoutFeatures;
|
||||||
import com.massivecraft.factions.struct.FFlag;
|
import com.massivecraft.factions.struct.FFlag;
|
||||||
@ -50,7 +50,7 @@ public class FactionsPlayerListener implements Listener
|
|||||||
public void onPlayerJoin(PlayerJoinEvent event)
|
public void onPlayerJoin(PlayerJoinEvent event)
|
||||||
{
|
{
|
||||||
// Make sure that all online players do have a fplayer.
|
// 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
|
// Update the lastLoginTime for this fplayer
|
||||||
me.setLastLoginTime(System.currentTimeMillis());
|
me.setLastLoginTime(System.currentTimeMillis());
|
||||||
@ -64,7 +64,7 @@ public class FactionsPlayerListener implements Listener
|
|||||||
@EventHandler(priority = EventPriority.NORMAL)
|
@EventHandler(priority = EventPriority.NORMAL)
|
||||||
public void onPlayerQuit(PlayerQuitEvent event)
|
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.
|
// Make sure player's power is up to date when they log off.
|
||||||
me.getPower();
|
me.getPower();
|
||||||
@ -91,7 +91,7 @@ public class FactionsPlayerListener implements Listener
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
FPlayer me = FPlayers.i.get(player);
|
FPlayer me = FPlayerColl.i.get(player);
|
||||||
|
|
||||||
// Did we change coord?
|
// Did we change coord?
|
||||||
FLocation from = me.getLastStoodAt();
|
FLocation from = me.getLastStoodAt();
|
||||||
@ -161,7 +161,7 @@ public class FactionsPlayerListener implements Listener
|
|||||||
int count = attempt.increment();
|
int count = attempt.increment();
|
||||||
if (count >= 10)
|
if (count >= 10)
|
||||||
{
|
{
|
||||||
FPlayer me = FPlayers.i.get(name);
|
FPlayer me = FPlayerColl.i.get(name);
|
||||||
me.msg("<b>Ouch, that is starting to hurt. You should give it a rest.");
|
me.msg("<b>Ouch, that is starting to hurt. You should give it a rest.");
|
||||||
player.damage(NumberConversions.floor((double)count / 10));
|
player.damage(NumberConversions.floor((double)count / 10));
|
||||||
}
|
}
|
||||||
@ -207,7 +207,7 @@ public class FactionsPlayerListener implements Listener
|
|||||||
String name = player.getName();
|
String name = player.getName();
|
||||||
if (ConfServer.playersWhoBypassAllProtection.contains(name)) return true;
|
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 (me.hasAdminMode()) return true;
|
||||||
if (ConfServer.materialsEditTools.contains(material) && ! FPerm.BUILD.has(me, loc, ! justCheck)) return false;
|
if (ConfServer.materialsEditTools.contains(material) && ! FPerm.BUILD.has(me, loc, ! justCheck)) return false;
|
||||||
return true;
|
return true;
|
||||||
@ -217,7 +217,7 @@ public class FactionsPlayerListener implements Listener
|
|||||||
String name = player.getName();
|
String name = player.getName();
|
||||||
if (ConfServer.playersWhoBypassAllProtection.contains(name)) return true;
|
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 (me.hasAdminMode()) return true;
|
||||||
Location loc = block.getLocation();
|
Location loc = block.getLocation();
|
||||||
Material material = block.getType();
|
Material material = block.getType();
|
||||||
@ -233,7 +233,7 @@ public class FactionsPlayerListener implements Listener
|
|||||||
@EventHandler(priority = EventPriority.HIGH)
|
@EventHandler(priority = EventPriority.HIGH)
|
||||||
public void onPlayerRespawn(PlayerRespawnEvent event)
|
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
|
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
|
// Get the player
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
FPlayer me = FPlayers.i.get(player);
|
FPlayer me = FPlayerColl.i.get(player);
|
||||||
|
|
||||||
// With adminmode no commands are denied.
|
// With adminmode no commands are denied.
|
||||||
if (me.hasAdminMode()) return;
|
if (me.hasAdminMode()) return;
|
||||||
@ -352,7 +352,7 @@ public class FactionsPlayerListener implements Listener
|
|||||||
{
|
{
|
||||||
if (event.isCancelled()) return;
|
if (event.isCancelled()) return;
|
||||||
|
|
||||||
FPlayer badGuy = FPlayers.i.get(event.getPlayer());
|
FPlayer badGuy = FPlayerColl.i.get(event.getPlayer());
|
||||||
if (badGuy == null)
|
if (badGuy == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -13,7 +13,7 @@ import com.massivecraft.factions.Board;
|
|||||||
import com.massivecraft.factions.ConfServer;
|
import com.massivecraft.factions.ConfServer;
|
||||||
import com.massivecraft.factions.FLocation;
|
import com.massivecraft.factions.FLocation;
|
||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayerColl;
|
||||||
import com.massivecraft.factions.Faction;
|
import com.massivecraft.factions.Faction;
|
||||||
import com.massivecraft.factions.Factions;
|
import com.massivecraft.factions.Factions;
|
||||||
import com.massivecraft.factions.Perm;
|
import com.massivecraft.factions.Perm;
|
||||||
@ -146,7 +146,7 @@ public enum FPerm
|
|||||||
|
|
||||||
if (testSubject instanceof Player)
|
if (testSubject instanceof Player)
|
||||||
{
|
{
|
||||||
rpSubject = FPlayers.i.get((Player)testSubject);
|
rpSubject = FPlayerColl.i.get((Player)testSubject);
|
||||||
}
|
}
|
||||||
else if (testSubject instanceof RelationParticipator)
|
else if (testSubject instanceof RelationParticipator)
|
||||||
{
|
{
|
||||||
@ -191,7 +191,7 @@ public enum FPerm
|
|||||||
{
|
{
|
||||||
FPlayer notify = null;
|
FPlayer notify = null;
|
||||||
if (testSubject instanceof Player)
|
if (testSubject instanceof Player)
|
||||||
notify = FPlayers.i.get((Player)testSubject);
|
notify = FPlayerColl.i.get((Player)testSubject);
|
||||||
else if (testSubject instanceof FPlayer)
|
else if (testSubject instanceof FPlayer)
|
||||||
notify = (FPlayer)testSubject;
|
notify = (FPlayer)testSubject;
|
||||||
if (notify != null)
|
if (notify != null)
|
||||||
|
@ -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.JsonPrimitive;
|
||||||
import org.bukkit.craftbukkit.libs.com.google.gson.JsonSerializationContext;
|
import org.bukkit.craftbukkit.libs.com.google.gson.JsonSerializationContext;
|
||||||
import org.bukkit.craftbukkit.libs.com.google.gson.JsonSerializer;
|
import org.bukkit.craftbukkit.libs.com.google.gson.JsonSerializer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayerColl;
|
||||||
|
|
||||||
|
|
||||||
public class TerritoryAccess implements JsonDeserializer<TerritoryAccess>, JsonSerializer<TerritoryAccess>
|
public class TerritoryAccess implements JsonDeserializer<TerritoryAccess>, JsonSerializer<TerritoryAccess>
|
||||||
@ -77,7 +77,7 @@ public class TerritoryAccess implements JsonDeserializer<TerritoryAccess>, JsonS
|
|||||||
if (testSubject instanceof String)
|
if (testSubject instanceof String)
|
||||||
return hostFactionID.equals((String)testSubject);
|
return hostFactionID.equals((String)testSubject);
|
||||||
else if (testSubject instanceof Player)
|
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)
|
else if (testSubject instanceof FPlayer)
|
||||||
return hostFactionID.equals(((FPlayer)testSubject).getFactionId());
|
return hostFactionID.equals(((FPlayer)testSubject).getFactionId());
|
||||||
else if (testSubject instanceof Faction)
|
else if (testSubject instanceof Faction)
|
||||||
@ -188,7 +188,7 @@ public class TerritoryAccess implements JsonDeserializer<TerritoryAccess>, JsonS
|
|||||||
public boolean subjectHasAccess(Object testSubject)
|
public boolean subjectHasAccess(Object testSubject)
|
||||||
{
|
{
|
||||||
if (testSubject instanceof Player)
|
if (testSubject instanceof Player)
|
||||||
return fPlayerHasAccess(FPlayers.i.get((Player)testSubject));
|
return fPlayerHasAccess(FPlayerColl.i.get((Player)testSubject));
|
||||||
else if (testSubject instanceof FPlayer)
|
else if (testSubject instanceof FPlayer)
|
||||||
return fPlayerHasAccess((FPlayer)testSubject);
|
return fPlayerHasAccess((FPlayer)testSubject);
|
||||||
else if (testSubject instanceof Faction)
|
else if (testSubject instanceof Faction)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.massivecraft.factions.util;
|
package com.massivecraft.factions.util;
|
||||||
|
|
||||||
import com.massivecraft.factions.ConfServer;
|
import com.massivecraft.factions.ConfServer;
|
||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayerColl;
|
||||||
import com.massivecraft.factions.Factions;
|
import com.massivecraft.factions.Factions;
|
||||||
|
|
||||||
public class AutoLeaveTask implements Runnable
|
public class AutoLeaveTask implements Runnable
|
||||||
@ -15,7 +15,7 @@ public class AutoLeaveTask implements Runnable
|
|||||||
|
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
FPlayers.i.autoLeaveOnInactivityRoutine();
|
FPlayerColl.i.autoLeaveOnInactivityRoutine();
|
||||||
|
|
||||||
// maybe setting has been changed? if so, restart task at new rate
|
// maybe setting has been changed? if so, restart task at new rate
|
||||||
if (this.rate != ConfServer.autoLeaveRoutineRunsEveryXMinutes)
|
if (this.rate != ConfServer.autoLeaveRoutineRunsEveryXMinutes)
|
||||||
|
Loading…
Reference in New Issue
Block a user