From bc194efc9bd20a2d61c41302bbbf7d61a3805b7e Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Mon, 22 Apr 2013 19:57:11 +0200 Subject: [PATCH] more variable renames for FPlayer --> UPlayer --- src/com/massivecraft/factions/FPerm.java | 8 +-- .../factions/FactionEqualsPredictate.java | 4 +- .../factions/entity/FactionColl.java | 2 +- .../factions/entity/FactionColls.java | 2 +- .../factions/entity/UPlayerColls.java | 8 +-- .../event/FactionsEventInvitedChange.java | 8 +-- .../event/FactionsEventMembershipChange.java | 8 +-- .../event/FactionsEventPowerChange.java | 8 +-- .../event/FactionsEventTitleChange.java | 8 +-- .../factions/integration/Econ.java | 16 ++--- .../factions/integration/SpoutFeatures.java | 40 ++++++------- .../herochat/FactionsChannelAbstract.java | 59 ------------------- .../listeners/FactionsListenerMain.java | 40 ++++++------- .../listeners/TodoFactionsPlayerListener.java | 50 ++++++++-------- .../factions/util/RelationUtil.java | 6 +- 15 files changed, 104 insertions(+), 163 deletions(-) diff --git a/src/com/massivecraft/factions/FPerm.java b/src/com/massivecraft/factions/FPerm.java index 7b2fa128..f2ffecbf 100644 --- a/src/com/massivecraft/factions/FPerm.java +++ b/src/com/massivecraft/factions/FPerm.java @@ -194,11 +194,11 @@ public enum FPerm if (!ret && informIfNot && rpSubject instanceof UPlayer) { - UPlayer fplayer = (UPlayer)rpSubject; - fplayer.msg(errorpattern, hostFaction.describeTo(fplayer, true), this.getDescription()); - if (Perm.ADMIN.has(fplayer.getPlayer())) + UPlayer uplayer = (UPlayer)rpSubject; + uplayer.msg(errorpattern, hostFaction.describeTo(uplayer, true), this.getDescription()); + if (Perm.ADMIN.has(uplayer.getPlayer())) { - fplayer.msg("You can bypass by using " + Factions.get().getOuterCmdFactions().cmdFactionsAdmin.getUseageTemplate(false)); + uplayer.msg("You can bypass by using " + Factions.get().getOuterCmdFactions().cmdFactionsAdmin.getUseageTemplate(false)); } } return ret; diff --git a/src/com/massivecraft/factions/FactionEqualsPredictate.java b/src/com/massivecraft/factions/FactionEqualsPredictate.java index 6c847ff1..07dba71c 100644 --- a/src/com/massivecraft/factions/FactionEqualsPredictate.java +++ b/src/com/massivecraft/factions/FactionEqualsPredictate.java @@ -35,8 +35,8 @@ public class FactionEqualsPredictate implements Predictate, Seria @Override public boolean apply(CommandSender sender) { - UPlayer fplayer = UPlayer.get(sender); - return this.factionId.equals(fplayer.getFactionId()); + UPlayer uplayer = UPlayer.get(sender); + return this.factionId.equals(uplayer.getFactionId()); } } \ No newline at end of file diff --git a/src/com/massivecraft/factions/entity/FactionColl.java b/src/com/massivecraft/factions/entity/FactionColl.java index e53dd9c9..b6c639b2 100644 --- a/src/com/massivecraft/factions/entity/FactionColl.java +++ b/src/com/massivecraft/factions/entity/FactionColl.java @@ -86,7 +86,7 @@ public class FactionColl extends Coll // INDEX // -------------------------------------------- // - public void reindexFPlayers() + public void reindexUPlayers() { for (Faction faction : this.getAll()) { diff --git a/src/com/massivecraft/factions/entity/FactionColls.java b/src/com/massivecraft/factions/entity/FactionColls.java index 2df45095..27ab2e86 100644 --- a/src/com/massivecraft/factions/entity/FactionColls.java +++ b/src/com/massivecraft/factions/entity/FactionColls.java @@ -119,7 +119,7 @@ public class FactionColls extends Colls { for (FactionColl coll : this.getColls()) { - coll.reindexFPlayers(); + coll.reindexUPlayers(); } } diff --git a/src/com/massivecraft/factions/entity/UPlayerColls.java b/src/com/massivecraft/factions/entity/UPlayerColls.java index 6fec5fa8..a8b0b60a 100644 --- a/src/com/massivecraft/factions/entity/UPlayerColls.java +++ b/src/com/massivecraft/factions/entity/UPlayerColls.java @@ -94,17 +94,17 @@ public class UPlayerColls extends Colls // Read the file content through GSON. Type type = new TypeToken>(){}.getType(); - Map id2fplayer = Factions.get().gson.fromJson(DiscUtil.readCatch(oldFile), type); + Map id2uplayer = Factions.get().gson.fromJson(DiscUtil.readCatch(oldFile), type); // The Coll UPlayerColl coll = this.getForUniverse(MCore.DEFAULT); // Set the data - for (Entry entry : id2fplayer.entrySet()) + for (Entry entry : id2uplayer.entrySet()) { String playerId = entry.getKey(); - UPlayer fplayer = entry.getValue(); - coll.attach(fplayer, playerId); + UPlayer uplayer = entry.getValue(); + coll.attach(uplayer, playerId); } // Mark as migrated diff --git a/src/com/massivecraft/factions/event/FactionsEventInvitedChange.java b/src/com/massivecraft/factions/event/FactionsEventInvitedChange.java index 369c5475..e082375b 100644 --- a/src/com/massivecraft/factions/event/FactionsEventInvitedChange.java +++ b/src/com/massivecraft/factions/event/FactionsEventInvitedChange.java @@ -20,8 +20,8 @@ public class FactionsEventInvitedChange extends FactionsEventAbstractSender // FIELDS // -------------------------------------------- // - private final UPlayer fplayer; - public UPlayer getFPlayer() { return this.fplayer; } + private final UPlayer uplayer; + public UPlayer getUPlayer() { return this.uplayer; } private final Faction faction; public Faction getFaction() { return this.faction; } @@ -34,10 +34,10 @@ public class FactionsEventInvitedChange extends FactionsEventAbstractSender // CONSTRUCT // -------------------------------------------- // - public FactionsEventInvitedChange(CommandSender sender, UPlayer fplayer, Faction faction, boolean newInvited) + public FactionsEventInvitedChange(CommandSender sender, UPlayer uplayer, Faction faction, boolean newInvited) { super(sender); - this.fplayer = fplayer; + this.uplayer = uplayer; this.faction = faction; this.newInvited = newInvited; } diff --git a/src/com/massivecraft/factions/event/FactionsEventMembershipChange.java b/src/com/massivecraft/factions/event/FactionsEventMembershipChange.java index aad3d721..b0ab9e3e 100644 --- a/src/com/massivecraft/factions/event/FactionsEventMembershipChange.java +++ b/src/com/massivecraft/factions/event/FactionsEventMembershipChange.java @@ -27,8 +27,8 @@ public class FactionsEventMembershipChange extends FactionsEventAbstractSender super.setCancelled(cancelled); } - private final UPlayer fplayer; - public UPlayer getFPlayer() { return this.fplayer; } + private final UPlayer uplayer; + public UPlayer getUPlayer() { return this.uplayer; } private final Faction newFaction; public Faction getNewFaction() { return this.newFaction; } @@ -40,10 +40,10 @@ public class FactionsEventMembershipChange extends FactionsEventAbstractSender // CONSTRUCT // -------------------------------------------- // - public FactionsEventMembershipChange(CommandSender sender, UPlayer fplayer, Faction newFaction, MembershipChangeReason reason) + public FactionsEventMembershipChange(CommandSender sender, UPlayer uplayer, Faction newFaction, MembershipChangeReason reason) { super(sender); - this.fplayer = fplayer; + this.uplayer = uplayer; this.newFaction = newFaction; this.reason = reason; } diff --git a/src/com/massivecraft/factions/event/FactionsEventPowerChange.java b/src/com/massivecraft/factions/event/FactionsEventPowerChange.java index e5d72ec1..7bc7e63f 100644 --- a/src/com/massivecraft/factions/event/FactionsEventPowerChange.java +++ b/src/com/massivecraft/factions/event/FactionsEventPowerChange.java @@ -19,8 +19,8 @@ public class FactionsEventPowerChange extends FactionsEventAbstractSender // FIELDS // -------------------------------------------- // - private final UPlayer fplayer; - public UPlayer getFPlayer() { return this.fplayer; } + private final UPlayer uplayer; + public UPlayer getUPlayer() { return this.uplayer; } private final PowerChangeReason reason; public PowerChangeReason getReason() { return this.reason; } @@ -33,10 +33,10 @@ public class FactionsEventPowerChange extends FactionsEventAbstractSender // CONSTRUCT // -------------------------------------------- // - public FactionsEventPowerChange(CommandSender sender, UPlayer fplayer, PowerChangeReason reason, double newPower) + public FactionsEventPowerChange(CommandSender sender, UPlayer uplayer, PowerChangeReason reason, double newPower) { super(sender); - this.fplayer = fplayer; + this.uplayer = uplayer; this.reason = reason; this.newPower = newPower; } diff --git a/src/com/massivecraft/factions/event/FactionsEventTitleChange.java b/src/com/massivecraft/factions/event/FactionsEventTitleChange.java index e2c9180d..b690631b 100644 --- a/src/com/massivecraft/factions/event/FactionsEventTitleChange.java +++ b/src/com/massivecraft/factions/event/FactionsEventTitleChange.java @@ -19,8 +19,8 @@ public class FactionsEventTitleChange extends FactionsEventAbstractSender // FIELDS // -------------------------------------------- // - private final UPlayer fplayer; - public UPlayer getFPlayer() { return this.fplayer; } + private final UPlayer uplayer; + public UPlayer getUPlayer() { return this.uplayer; } private String newTitle; public String getNewTitle() { return this.newTitle; } @@ -30,10 +30,10 @@ public class FactionsEventTitleChange extends FactionsEventAbstractSender // CONSTRUCT // -------------------------------------------- // - public FactionsEventTitleChange(CommandSender sender, UPlayer fplayer, String newTitle) + public FactionsEventTitleChange(CommandSender sender, UPlayer uplayer, String newTitle) { super(sender); - this.fplayer = fplayer; + this.uplayer = uplayer; this.newTitle = newTitle; } diff --git a/src/com/massivecraft/factions/integration/Econ.java b/src/com/massivecraft/factions/integration/Econ.java index 1b12f8da..d675246e 100644 --- a/src/com/massivecraft/factions/integration/Econ.java +++ b/src/com/massivecraft/factions/integration/Econ.java @@ -167,9 +167,9 @@ public class Econ return false; } - public static Set getFplayers(EconomyParticipator ep) + public static Set getUPlayers(EconomyParticipator ep) { - Set fplayers = new HashSet(); + Set uplayers = new HashSet(); if (ep == null) { @@ -177,22 +177,22 @@ public class Econ } else if (ep instanceof UPlayer) { - fplayers.add((UPlayer)ep); + uplayers.add((UPlayer)ep); } else if (ep instanceof Faction) { - fplayers.addAll(((Faction)ep).getUPlayers()); + uplayers.addAll(((Faction)ep).getUPlayers()); } - return fplayers; + return uplayers; } public static void sendTransferInfo(EconomyParticipator invoker, EconomyParticipator from, EconomyParticipator to, double amount) { Set recipients = new HashSet(); - recipients.addAll(getFplayers(invoker)); - recipients.addAll(getFplayers(from)); - recipients.addAll(getFplayers(to)); + recipients.addAll(getUPlayers(invoker)); + recipients.addAll(getUPlayers(from)); + recipients.addAll(getUPlayers(to)); if (invoker == null) { diff --git a/src/com/massivecraft/factions/integration/SpoutFeatures.java b/src/com/massivecraft/factions/integration/SpoutFeatures.java index e8103cae..a749e9c7 100644 --- a/src/com/massivecraft/factions/integration/SpoutFeatures.java +++ b/src/com/massivecraft/factions/integration/SpoutFeatures.java @@ -72,9 +72,9 @@ public class SpoutFeatures for (Player player : fromPlayers) { - UPlayer fplayer = UPlayer.get(player); + UPlayer uplayer = UPlayer.get(player); SpoutPlayer splayer = SpoutManager.getPlayer(player); - Faction faction = fplayer.getFaction(); + Faction faction = uplayer.getFaction(); String cape = faction.getCape(); if (cape == null) @@ -137,19 +137,19 @@ public class SpoutFeatures for (Player player : fromPlayers) { - UPlayer fplayer = UPlayer.get(player); + UPlayer uplayer = UPlayer.get(player); SpoutPlayer splayer = SpoutManager.getPlayer(player); - Faction faction = fplayer.getFaction(); + Faction faction = uplayer.getFaction(); for (Player playerTo : toPlayers) { - UPlayer fplayerTo = UPlayer.get(playerTo); + UPlayer uplayerTo = UPlayer.get(playerTo); SpoutPlayer splayerTo = SpoutManager.getPlayer(playerTo); - Faction factionTo = fplayerTo.getFaction(); + Faction factionTo = uplayerTo.getFaction(); ChatColor relationColor = faction.getRelationTo(factionTo).getColor(); - String title = generateTitle(player, fplayer, faction, relationColor); + String title = generateTitle(player, uplayer, faction, relationColor); boolean skip = onlyIfDifferent && title.equals(splayer.getTitleFor(splayerTo)); //Bukkit.getConsoleSender().sendMessage(P.p.txt.parse("TITLE SKIP:%s FROM %s TO %s TITLE %s", String.valueOf(skip), player.getDisplayName(), playerTo.getDisplayName(), title)); @@ -178,7 +178,7 @@ public class SpoutFeatures }, 5); } - public static String generateTitle(Player player, UPlayer fplayer, Faction faction, ChatColor relationColor) + public static String generateTitle(Player player, UPlayer uplayer, Faction faction, ChatColor relationColor) { String ret = null; @@ -189,12 +189,12 @@ public class SpoutFeatures String addTag = ""; if (ConfServer.spoutFactionTagsOverNames) { - addTag += relationColor.toString() + fplayer.getRole().getPrefix() + faction.getTag(); + addTag += relationColor.toString() + uplayer.getRole().getPrefix() + faction.getTag(); } - if (ConfServer.spoutFactionTitlesOverNames && fplayer.hasTitle()) + if (ConfServer.spoutFactionTitlesOverNames && uplayer.hasTitle()) { - addTag += (addTag.isEmpty() ? "" : " ") + fplayer.getTitle(); + addTag += (addTag.isEmpty() ? "" : " ") + uplayer.getTitle(); } ret = addTag + "\n" + ret; @@ -222,8 +222,8 @@ public class SpoutFeatures } else if (o instanceof UPlayer) { - UPlayer fplayer = (UPlayer)o; - Player player = fplayer.getPlayer(); + UPlayer uplayer = (UPlayer)o; + Player player = uplayer.getPlayer(); if (player != null) { ret.add(player); @@ -252,14 +252,14 @@ public class SpoutFeatures for (Player player : Bukkit.getOnlinePlayers()) { - UPlayer fplayer = UPlayer.get(player); + UPlayer uplayer = UPlayer.get(player); if (chunk == null) { - mainListener.updateTerritoryDisplay(fplayer, false); + mainListener.updateTerritoryDisplay(uplayer, false); } - else if (fplayer.getCurrentChunk().equals(chunk)) + else if (uplayer.getCurrentChunk().equals(chunk)) { - mainListener.updateTerritoryDisplay(fplayer, true); + mainListener.updateTerritoryDisplay(uplayer, true); } } } @@ -280,10 +280,10 @@ public class SpoutFeatures for (Player player : Bukkit.getOnlinePlayers()) { - UPlayer fplayer = UPlayer.get(player); - if (chunk == null || fplayer.getCurrentChunk().equals(chunk)) + UPlayer uplayer = UPlayer.get(player); + if (chunk == null || uplayer.getCurrentChunk().equals(chunk)) { - mainListener.updateAccessInfo(fplayer); + mainListener.updateAccessInfo(uplayer); } } } diff --git a/src/com/massivecraft/factions/integration/herochat/FactionsChannelAbstract.java b/src/com/massivecraft/factions/integration/herochat/FactionsChannelAbstract.java index d2592c21..5dd7790a 100644 --- a/src/com/massivecraft/factions/integration/herochat/FactionsChannelAbstract.java +++ b/src/com/massivecraft/factions/integration/herochat/FactionsChannelAbstract.java @@ -264,65 +264,6 @@ public abstract class FactionsChannelAbstract implements Channel Herochat.logChat(msg); } - /*@Override - public void processChat(ChannelChatEvent event) - { - final Player player = event.getSender().getPlayer(); - - String format = applyFormat(event.getFormat(), event.getBukkitFormat(), player); - - Chatter sender = Herochat.getChatterManager().getChatter(player); - Set recipients = new HashSet(Arrays.asList(Bukkit.getOnlinePlayers())); - - trimRecipients(recipients, sender); - if (!isMessageHeard(recipients, sender)) - { - Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Herochat.getPlugin(), new Runnable() - { - public void run() - { - try - { - Messaging.send(player, Herochat.getMessage("channel_alone")); - } - catch (MessageNotFoundException e) - { - Herochat.severe("Messages.properties is missing: channel_alone"); - } - } - }, 1L); - } - - FPlayer fplayer = FPlayers.i.get(player); - - String formatWithoutColor = FactionsChatListener.parseTags(format, player, fplayer); - - //String msg = String.format(format, player.getDisplayName(), event.getMessage()); - - - for (Player recipient : recipients) - { - String finalFormat; - if ( ! Conf.chatParseTags || Conf.chatTagHandledByAnotherPlugin) - { - finalFormat = format; - } - else if (! Conf.chatParseTagsColored) - { - finalFormat = formatWithoutColor; - } - else - { - FPlayer frecipient = FPlayers.i.get(recipient); - finalFormat = FactionsChatListener.parseTags(format, player, fplayer, recipient, frecipient); - } - String msg = String.format(finalFormat, player.getDisplayName(), event.getMessage()); - recipient.sendMessage(msg); - } - - Herochat.logChat(String.format(formatWithoutColor, player.getDisplayName(), event.getMessage())); - }*/ - public boolean isMessageHeard(Set recipients, Chatter sender) { if (!isLocal()) return true; diff --git a/src/com/massivecraft/factions/listeners/FactionsListenerMain.java b/src/com/massivecraft/factions/listeners/FactionsListenerMain.java index 0b1507da..dac067c6 100644 --- a/src/com/massivecraft/factions/listeners/FactionsListenerMain.java +++ b/src/com/massivecraft/factions/listeners/FactionsListenerMain.java @@ -89,35 +89,35 @@ public class FactionsListenerMain implements Listener { // If a player dies ... Player player = event.getEntity(); - UPlayer fplayer = UPlayer.get(player); + UPlayer uplayer = UPlayer.get(player); // ... and powerloss can happen here ... Faction faction = BoardColls.get().getFactionAt(PS.valueOf(player)); if (!faction.getFlag(FFlag.POWERLOSS)) { - fplayer.msg("You didn't lose any power since the territory you died in works that way."); + uplayer.msg("You didn't lose any power since the territory you died in works that way."); return; } if (MConf.get().worldsNoPowerLoss.contains(player.getWorld().getName())) { - fplayer.msg("You didn't lose any power due to the world you died in."); + uplayer.msg("You didn't lose any power due to the world you died in."); return; } // ... Event ... - double newPower = fplayer.getPower() + UConf.get(fplayer).powerPerDeath; - FactionsEventPowerChange powerChangeEvent = new FactionsEventPowerChange(null, fplayer, PowerChangeReason.DEATH, newPower); + double newPower = uplayer.getPower() + UConf.get(uplayer).powerPerDeath; + FactionsEventPowerChange powerChangeEvent = new FactionsEventPowerChange(null, uplayer, PowerChangeReason.DEATH, newPower); powerChangeEvent.run(); if (powerChangeEvent.isCancelled()) return; newPower = powerChangeEvent.getNewPower(); // ... alter the power ... - fplayer.setPower(newPower); + uplayer.setPower(newPower); // ... and inform the player. - fplayer.msg("Your power is now %d / %d", fplayer.getPowerRounded(), fplayer.getPowerMaxRounded()); + uplayer.msg("Your power is now %d / %d", uplayer.getPowerRounded(), uplayer.getPowerMaxRounded()); } // -------------------------------------------- // @@ -292,7 +292,7 @@ public class FactionsListenerMain implements Listener { // If a player was kicked from the server ... Player player = event.getPlayer(); - UPlayer fplayer = UPlayer.get(player); + UPlayer uplayer = UPlayer.get(player); // ... and if the if player was banned (not just kicked) ... if (!event.getReason().equals("Banned by admin.")) return; @@ -301,12 +301,12 @@ public class FactionsListenerMain implements Listener if (!ConfServer.removePlayerDataWhenBanned) return; // ... get rid of their stored info. - if (fplayer.getRole() == Rel.LEADER) + if (uplayer.getRole() == Rel.LEADER) { - fplayer.getFaction().promoteNewLeader(); + uplayer.getFaction().promoteNewLeader(); } - fplayer.leave(false); - fplayer.detach(); + uplayer.leave(false); + uplayer.detach(); } @@ -331,10 +331,10 @@ public class FactionsListenerMain implements Listener { // If a player is trying to run a command ... Player player = event.getPlayer(); - UPlayer fplayer = UPlayer.get(player); + UPlayer uplayer = UPlayer.get(player); // ... and the player does not have adminmode ... - if (fplayer.isUsingAdminMode()) return; + if (uplayer.isUsingAdminMode()) return; // ... clean up the command ... String command = event.getMessage(); @@ -342,26 +342,26 @@ public class FactionsListenerMain implements Listener command = command.toLowerCase(); command = command.trim(); - if (fplayer.hasFaction() && fplayer.getFaction().getFlag(FFlag.PERMANENT) && containsCommand(command, ConfServer.permanentFactionMemberDenyCommands)) + if (uplayer.hasFaction() && uplayer.getFaction().getFlag(FFlag.PERMANENT) && containsCommand(command, ConfServer.permanentFactionMemberDenyCommands)) { - fplayer.msg("You can't use \"/%s\" as member of a permanent faction.", command); + uplayer.msg("You can't use \"/%s\" as member of a permanent faction.", command); event.setCancelled(true); return; } - Rel rel = fplayer.getRelationToLocation(); - if (BoardColls.get().getFactionAt(fplayer.getCurrentChunk()).isNone()) return; + Rel rel = uplayer.getRelationToLocation(); + if (BoardColls.get().getFactionAt(uplayer.getCurrentChunk()).isNone()) return; if (rel == Rel.NEUTRAL && containsCommand(command, ConfServer.territoryNeutralDenyCommands)) { - fplayer.msg("You can't use \"/%s\" in neutral territory.", command); + uplayer.msg("You can't use \"/%s\" in neutral territory.", command); event.setCancelled(true); return; } if (rel == Rel.ENEMY && containsCommand(command, ConfServer.territoryEnemyDenyCommands)) { - fplayer.msg("You can't use \"/%s\" in enemy territory.", command); + uplayer.msg("You can't use \"/%s\" in enemy territory.", command); event.setCancelled(true); return; } diff --git a/src/com/massivecraft/factions/listeners/TodoFactionsPlayerListener.java b/src/com/massivecraft/factions/listeners/TodoFactionsPlayerListener.java index a86791a3..46622198 100644 --- a/src/com/massivecraft/factions/listeners/TodoFactionsPlayerListener.java +++ b/src/com/massivecraft/factions/listeners/TodoFactionsPlayerListener.java @@ -32,18 +32,18 @@ public class TodoFactionsPlayerListener implements Listener { // If a player is joining the server ... Player player = event.getPlayer(); - UPlayer fplayer = UPlayer.get(player); + UPlayer uplayer = UPlayer.get(player); // ... recalculate their power as if they were offline since last recalculation ... - fplayer.recalculatePower(false); + uplayer.recalculatePower(false); // ... update the current chunk ... - fplayer.setCurrentChunk(PS.valueOf(event.getPlayer())); + uplayer.setCurrentChunk(PS.valueOf(event.getPlayer())); // ... notify the player about where they are ... - if ( ! SpoutFeatures.updateTerritoryDisplay(fplayer)) + if ( ! SpoutFeatures.updateTerritoryDisplay(uplayer)) { - fplayer.sendFactionHereMessage(); + uplayer.sendFactionHereMessage(); } } @@ -51,14 +51,14 @@ public class TodoFactionsPlayerListener implements Listener public void onPlayerLeave(MCorePlayerLeaveEvent event) { Player player = event.getPlayer(); - UPlayer fplayer = UPlayer.get(player); + UPlayer uplayer = UPlayer.get(player); // Recalculate the power before the player leaves. // This is required since we recalculate as if the player were offline when they log back in. // TODO: When I setup universes I must do this for all universe instance of the player that logs off! - fplayer.recalculatePower(true); + uplayer.recalculatePower(true); - SpoutFeatures.playerDisconnect(fplayer); + SpoutFeatures.playerDisconnect(uplayer); } @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) @@ -69,12 +69,12 @@ public class TodoFactionsPlayerListener implements Listener // ... update the stored current chunk ... Player player = event.getPlayer(); - UPlayer fplayer = UPlayer.get(player); + UPlayer uplayer = UPlayer.get(player); - PS chunkFrom = fplayer.getCurrentChunk(); + PS chunkFrom = uplayer.getCurrentChunk(); PS chunkTo = PS.valueOf(event.getTo()).getChunk(true); - fplayer.setCurrentChunk(chunkTo); + uplayer.setCurrentChunk(chunkTo); // ... TODO: assorted and uncleaned code below ... @@ -84,29 +84,29 @@ public class TodoFactionsPlayerListener implements Listener boolean changedFaction = (BoardColls.get().getFactionAt(chunkFrom) != BoardColls.get().getFactionAt(chunkTo)); // let Spout handle most of this if it's available - boolean handledBySpout = changedFaction && SpoutFeatures.updateTerritoryDisplay(fplayer); + boolean handledBySpout = changedFaction && SpoutFeatures.updateTerritoryDisplay(uplayer); - if (fplayer.isMapAutoUpdating()) + if (uplayer.isMapAutoUpdating()) { - fplayer.sendMessage(BoardColls.get().getMap(fplayer.getFaction(), chunkTo, player.getLocation().getYaw())); + uplayer.sendMessage(BoardColls.get().getMap(uplayer.getFaction(), chunkTo, player.getLocation().getYaw())); } else if (changedFaction && ! handledBySpout) { - fplayer.sendFactionHereMessage(); + uplayer.sendFactionHereMessage(); } // show access info message if needed - if ( ! handledBySpout && ! SpoutFeatures.updateAccessInfo(fplayer) && ! access.isDefault()) + if ( ! handledBySpout && ! SpoutFeatures.updateAccessInfo(uplayer) && ! access.isDefault()) { - if (access.subjectHasAccess(fplayer)) - fplayer.msg("You have access to this area."); - else if (access.subjectAccessIsRestricted(fplayer)) - fplayer.msg("This area has restricted access."); + if (access.subjectHasAccess(uplayer)) + uplayer.msg("You have access to this area."); + else if (access.subjectAccessIsRestricted(uplayer)) + uplayer.msg("This area has restricted access."); } - if (fplayer.getAutoClaimFor() != null) + if (uplayer.getAutoClaimFor() != null) { - fplayer.attemptClaim(fplayer.getAutoClaimFor(), PS.valueOf(event.getTo()), true); + uplayer.attemptClaim(uplayer.getAutoClaimFor(), PS.valueOf(event.getTo()), true); } } @@ -145,10 +145,10 @@ public class TodoFactionsPlayerListener implements Listener String name = player.getName(); if (MConf.get().playersWhoBypassAllProtection.contains(name)) return true; - UPlayer fplayer = UPlayer.get(player); - if (fplayer.isUsingAdminMode()) return true; + UPlayer uplayer = UPlayer.get(player); + if (uplayer.isUsingAdminMode()) return true; - return FPerm.BUILD.has(fplayer, ps, !justCheck); + return FPerm.BUILD.has(uplayer, ps, !justCheck); } public static boolean canPlayerUseBlock(Player player, Block block, boolean justCheck) diff --git a/src/com/massivecraft/factions/util/RelationUtil.java b/src/com/massivecraft/factions/util/RelationUtil.java index ac72eb1f..4882ed00 100644 --- a/src/com/massivecraft/factions/util/RelationUtil.java +++ b/src/com/massivecraft/factions/util/RelationUtil.java @@ -40,18 +40,18 @@ public class RelationUtil } else if (that instanceof UPlayer) { - UPlayer fplayerthat = (UPlayer) that; + UPlayer uplayerthat = (UPlayer) that; if (that == me) { ret = "you"; } else if (thatFaction == myFaction) { - ret = fplayerthat.getNameAndTitle(); + ret = uplayerthat.getNameAndTitle(); } else { - ret = fplayerthat.getNameAndTag(); + ret = uplayerthat.getNameAndTag(); } }