From 0b60a5ad1a36e0178493ec95d92f7c0d582dfbf9 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Wed, 17 Sep 2014 13:29:58 +0200 Subject: [PATCH] Loads of UPlayer --> MPlayer renames --- .../java/com/massivecraft/factions/Const.java | 2 +- .../java/com/massivecraft/factions/FPerm.java | 26 ++--- .../factions/FactionEqualsPredictate.java | 4 +- .../factions/FactionListComparator.java | 4 +- .../com/massivecraft/factions/Factions.java | 2 +- .../factions/TerritoryAccess.java | 12 +-- .../cmd/CmdFactionsAccessAbstract.java | 6 +- .../factions/cmd/CmdFactionsAccessPlayer.java | 10 +- .../factions/cmd/CmdFactionsDemote.java | 4 +- .../factions/cmd/CmdFactionsDescription.java | 2 +- .../factions/cmd/CmdFactionsDisband.java | 14 +-- .../factions/cmd/CmdFactionsFaction.java | 2 +- .../factions/cmd/CmdFactionsInvite.java | 24 ++--- .../factions/cmd/CmdFactionsJoin.java | 46 ++++----- .../factions/cmd/CmdFactionsKick.java | 36 +++---- .../factions/cmd/CmdFactionsLeader.java | 10 +- .../factions/cmd/CmdFactionsList.java | 6 +- .../cmd/CmdFactionsMoneyTransferFp.java | 4 +- .../cmd/CmdFactionsMoneyTransferPf.java | 4 +- .../factions/cmd/CmdFactionsOfficer.java | 4 +- .../factions/cmd/CmdFactionsPlayer.java | 26 ++--- .../factions/cmd/CmdFactionsPowerBoost.java | 4 +- .../factions/cmd/CmdFactionsPromote.java | 4 +- .../factions/cmd/CmdFactionsTitle.java | 4 +- .../factions/cmd/arg/ARFaction.java | 8 +- .../arg/{ARUPlayer.java => ARMPlayer.java} | 2 +- .../factions/cmd/req/ReqRoleIsAtLeast.java | 4 +- .../massivecraft/factions/entity/Board.java | 2 +- .../massivecraft/factions/entity/Faction.java | 94 +++++++++---------- .../factions/entity/FactionColl.java | 12 +-- .../massivecraft/factions/entity/MPlayer.java | 28 +++--- .../factions/entity/MPlayerColl.java | 40 ++++---- .../event/EventFactionsInvitedChange.java | 8 +- .../event/EventFactionsMembershipChange.java | 8 +- .../event/EventFactionsPowerChange.java | 10 +- .../event/EventFactionsTitleChange.java | 8 +- .../factions/integration/Econ.java | 16 ++-- .../integration/dynmap/EngineDynmap.java | 26 ++--- .../factions/integration/lwc/EngineLwc.java | 2 +- .../listeners/FactionsListenerEcon.java | 8 +- .../listeners/FactionsListenerMain.java | 56 +++++------ .../factions/mixin/PowerMixin.java | 10 +- .../factions/util/RelationUtil.java | 6 +- 43 files changed, 303 insertions(+), 305 deletions(-) rename src/main/java/com/massivecraft/factions/cmd/arg/{ARUPlayer.java => ARMPlayer.java} (91%) diff --git a/src/main/java/com/massivecraft/factions/Const.java b/src/main/java/com/massivecraft/factions/Const.java index fc2b6412..b140900f 100644 --- a/src/main/java/com/massivecraft/factions/Const.java +++ b/src/main/java/com/massivecraft/factions/Const.java @@ -7,7 +7,7 @@ public class Const public static final String BASENAME_ = BASENAME+"_"; public static final String COLLECTION_BOARD = BASENAME_+"board"; - public static final String COLLECTION_FACTION = BASENAME_+"faction"; + public static final String COLLECTION_FACTION = BASENAME_+"faction"; public static final String COLLECTION_MPLAYER = BASENAME_+"mplayer"; public static final String COLLECTION_MCONF = BASENAME_+"mconf"; diff --git a/src/main/java/com/massivecraft/factions/FPerm.java b/src/main/java/com/massivecraft/factions/FPerm.java index e0250001..a7d80c19 100644 --- a/src/main/java/com/massivecraft/factions/FPerm.java +++ b/src/main/java/com/massivecraft/factions/FPerm.java @@ -125,10 +125,10 @@ public enum FPerm // HAS? // -------------------------------------------- // - public String createDeniedMessage(MPlayer uplayer, Faction hostFaction) + public String createDeniedMessage(MPlayer mplayer, Faction hostFaction) { - String ret = Txt.parse("%s does not allow you to %s.", hostFaction.describeTo(uplayer, true), this.getDescription()); - if (Perm.ADMIN.has(uplayer.getPlayer())) + String ret = Txt.parse("%s does not allow you to %s.", hostFaction.describeTo(mplayer, true), this.getDescription()); + if (Perm.ADMIN.has(mplayer.getPlayer())) { ret += Txt.parse("\nYou can bypass by using " + Factions.get().getOuterCmdFactions().cmdFactionsAdmin.getUseageTemplate(false)); } @@ -141,39 +141,39 @@ public enum FPerm return hostFaction.getPermittedRelations(this).contains(rel); } - public boolean has(MPlayer uplayer, Faction hostFaction, boolean verboose) + public boolean has(MPlayer mplayer, Faction hostFaction, boolean verboose) { - if (uplayer.isUsingAdminMode()) return true; + if (mplayer.isUsingAdminMode()) return true; - Rel rel = uplayer.getRelationTo(hostFaction); + Rel rel = mplayer.getRelationTo(hostFaction); if (hostFaction.getPermittedRelations(this).contains(rel)) return true; - if (verboose) uplayer.sendMessage(this.createDeniedMessage(uplayer, hostFaction)); + if (verboose) mplayer.sendMessage(this.createDeniedMessage(mplayer, hostFaction)); return false; } - public boolean has(MPlayer uplayer, PS ps, boolean verboose) + public boolean has(MPlayer mplayer, PS ps, boolean verboose) { - if (uplayer.isUsingAdminMode()) return true; + if (mplayer.isUsingAdminMode()) return true; TerritoryAccess ta = BoardColl.get().getTerritoryAccessAt(ps); - Faction hostFaction = ta.getHostFaction(ps); + Faction hostFaction = ta.getHostFaction(); if (this.isTerritoryPerm()) { - Boolean hasTerritoryAccess = ta.hasTerritoryAccess(uplayer); + Boolean hasTerritoryAccess = ta.hasTerritoryAccess(mplayer); if (hasTerritoryAccess != null) { if (verboose && !hasTerritoryAccess) { - uplayer.sendMessage(this.createDeniedMessage(uplayer, hostFaction)); + mplayer.sendMessage(this.createDeniedMessage(mplayer, hostFaction)); } return hasTerritoryAccess; } } - return this.has(uplayer, hostFaction, verboose); + return this.has(mplayer, hostFaction, verboose); } // -------------------------------------------- // diff --git a/src/main/java/com/massivecraft/factions/FactionEqualsPredictate.java b/src/main/java/com/massivecraft/factions/FactionEqualsPredictate.java index 40e9e1d7..c4424541 100644 --- a/src/main/java/com/massivecraft/factions/FactionEqualsPredictate.java +++ b/src/main/java/com/massivecraft/factions/FactionEqualsPredictate.java @@ -35,8 +35,8 @@ public class FactionEqualsPredictate implements Predictate, Seria @Override public boolean apply(CommandSender sender) { - MPlayer uplayer = MPlayer.get(sender); - return this.factionId.equals(uplayer.getFactionId()); + MPlayer mplayer = MPlayer.get(sender); + return this.factionId.equals(mplayer.getFactionId()); } } \ No newline at end of file diff --git a/src/main/java/com/massivecraft/factions/FactionListComparator.java b/src/main/java/com/massivecraft/factions/FactionListComparator.java index c73f6890..95c53c84 100644 --- a/src/main/java/com/massivecraft/factions/FactionListComparator.java +++ b/src/main/java/com/massivecraft/factions/FactionListComparator.java @@ -36,11 +36,11 @@ public class FactionListComparator implements Comparator if (ret != 0) return ret; // Players Online - ret = f2.getUPlayersWhereOnline(true).size() - f1.getUPlayersWhereOnline(true).size(); + ret = f2.getMPlayersWhereOnline(true).size() - f1.getMPlayersWhereOnline(true).size(); if (ret != 0) return ret; // Players Total - ret = f2.getUPlayers().size() - f1.getUPlayers().size(); + ret = f2.getMPlayers().size() - f1.getMPlayers().size(); if (ret != 0) return ret; // Tie by Id diff --git a/src/main/java/com/massivecraft/factions/Factions.java b/src/main/java/com/massivecraft/factions/Factions.java index d06406e4..27738f46 100644 --- a/src/main/java/com/massivecraft/factions/Factions.java +++ b/src/main/java/com/massivecraft/factions/Factions.java @@ -117,7 +117,7 @@ public class Factions extends MassivePlugin MPlayerColl.get().init(); FactionColl.get().init(); BoardColl.get().init(); - FactionColl.get().reindexUPlayers(); + FactionColl.get().reindexMPlayers(); this.databaseInitialized = true; // Commands diff --git a/src/main/java/com/massivecraft/factions/TerritoryAccess.java b/src/main/java/com/massivecraft/factions/TerritoryAccess.java index 5a32e998..b9a4cbd2 100644 --- a/src/main/java/com/massivecraft/factions/TerritoryAccess.java +++ b/src/main/java/com/massivecraft/factions/TerritoryAccess.java @@ -94,12 +94,12 @@ public class TerritoryAccess // FIELDS: UNIVERSED // -------------------------------------------- // - public Faction getHostFaction(Object universe) + public Faction getHostFaction() { return FactionColl.get().get(this.getHostFactionId()); } - public LinkedHashSet getGrantedUPlayers(Object universe) + public LinkedHashSet getGrantedMPlayers() { LinkedHashSet ret = new LinkedHashSet(); for (String playerId : this.getPlayerIds()) @@ -109,7 +109,7 @@ public class TerritoryAccess return ret; } - public LinkedHashSet getGrantedFactions(Object universe) + public LinkedHashSet getGrantedFactions() { LinkedHashSet ret = new LinkedHashSet(); for (String factionId : this.getFactionIds()) @@ -200,11 +200,11 @@ public class TerritoryAccess // true means elevated access // false means decreased access // null means standard access - public Boolean hasTerritoryAccess(MPlayer uplayer) + public Boolean hasTerritoryAccess(MPlayer mplayer) { - if (this.getPlayerIds().contains(uplayer.getId())) return true; + if (this.getPlayerIds().contains(mplayer.getId())) return true; - String factionId = uplayer.getFactionId(); + String factionId = mplayer.getFactionId(); if (this.getFactionIds().contains(factionId)) return true; if (this.getHostFactionId().equals(factionId) && !this.isHostFactionAllowed()) return false; diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsAccessAbstract.java b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsAccessAbstract.java index 90f2b140..9ccf742e 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsAccessAbstract.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsAccessAbstract.java @@ -43,7 +43,7 @@ public abstract class CmdFactionsAccessAbstract extends FCommand { chunk = PS.valueOf(me).getChunk(true); ta = BoardColl.get().getTerritoryAccessAt(chunk); - hostFaction = ta.getHostFaction(usender); + hostFaction = ta.getHostFaction(); this.innerPerform(); } @@ -55,8 +55,8 @@ public abstract class CmdFactionsAccessAbstract extends FCommand sendMessage(Txt.titleize("Access at " + chunk.toString(PSFormatHumanSpace.get()))); msg("Host Faction: %s", hostFaction.describeTo(usender, true)); msg("Host Faction Allowed: %s", ta.isHostFactionAllowed() ? Txt.parse("TRUE") : Txt.parse("FALSE")); - msg("Granted Players: %s", describeRelationParticipators(ta.getGrantedUPlayers(usender), usender)); - msg("Granted Factions: %s", describeRelationParticipators(ta.getGrantedFactions(usender), usender)); + msg("Granted Players: %s", describeRelationParticipators(ta.getGrantedMPlayers(), usender)); + msg("Granted Factions: %s", describeRelationParticipators(ta.getGrantedFactions(), usender)); } public static String describeRelationParticipators(Collection relationParticipators, RelationParticipator observer) diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsAccessPlayer.java b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsAccessPlayer.java index f230865e..56944866 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsAccessPlayer.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsAccessPlayer.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.FPerm; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARUPlayer; +import com.massivecraft.factions.cmd.arg.ARMPlayer; import com.massivecraft.factions.entity.BoardColl; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.massivecore.cmd.arg.ARBoolean; @@ -35,17 +35,17 @@ public class CmdFactionsAccessPlayer extends CmdFactionsAccessAbstract public void innerPerform() { // Args - MPlayer uplayer = this.arg(0, ARUPlayer.getAny()); - if (uplayer == null) return; + MPlayer mplayer = this.arg(0, ARMPlayer.getAny()); + if (mplayer == null) return; - Boolean newValue = this.arg(1, ARBoolean.get(), !ta.isPlayerIdGranted(uplayer.getId())); + Boolean newValue = this.arg(1, ARBoolean.get(), !ta.isPlayerIdGranted(mplayer.getId())); if (newValue == null) return; // FPerm if (!FPerm.ACCESS.has(usender, hostFaction, true)) return; // Apply - ta = ta.withPlayerId(uplayer.getId(), newValue); + ta = ta.withPlayerId(mplayer.getId(), newValue); BoardColl.get().setTerritoryAccessAt(chunk, ta); // Inform diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsDemote.java b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsDemote.java index 59c07d8e..5622fc21 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsDemote.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsDemote.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; import com.massivecraft.factions.Rel; -import com.massivecraft.factions.cmd.arg.ARUPlayer; +import com.massivecraft.factions.cmd.arg.ARMPlayer; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; @@ -35,7 +35,7 @@ public class CmdFactionsDemote extends FCommand @Override public void perform() { - MPlayer you = this.arg(0, ARUPlayer.getAny()); + MPlayer you = this.arg(0, ARMPlayer.getAny()); if (you == null) return; if (you.getFaction() != usenderFaction) diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsDescription.java b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsDescription.java index 89d14fce..ecdf7579 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsDescription.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsDescription.java @@ -50,7 +50,7 @@ public class CmdFactionsDescription extends FCommand usenderFaction.setDescription(newDescription); // Inform - for (MPlayer follower : usenderFaction.getUPlayers()) + for (MPlayer follower : usenderFaction.getMPlayers()) { follower.msg("%s set your faction description to:\n%s", Mixin.getDisplayName(sender, follower), usenderFaction.getDescription()); } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsDisband.java b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsDisband.java index e039f99d..38410c8c 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsDisband.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsDisband.java @@ -64,23 +64,23 @@ public class CmdFactionsDisband extends FCommand // Merged Apply and Inform // Run event for each player in the faction - for (MPlayer uplayer : faction.getUPlayers()) + for (MPlayer mplayer : faction.getMPlayers()) { - EventFactionsMembershipChange membershipChangeEvent = new EventFactionsMembershipChange(sender, uplayer, FactionColl.get().getNone(), MembershipChangeReason.DISBAND); + EventFactionsMembershipChange membershipChangeEvent = new EventFactionsMembershipChange(sender, mplayer, FactionColl.get().getNone(), MembershipChangeReason.DISBAND); membershipChangeEvent.run(); } // Inform all players - for (MPlayer uplayer : MPlayerColl.get().getAllOnline()) + for (MPlayer mplayer : MPlayerColl.get().getAllOnline()) { - String who = usender.describeTo(uplayer); - if (uplayer.getFaction() == faction) + String who = usender.describeTo(mplayer); + if (mplayer.getFaction() == faction) { - uplayer.msg("%s disbanded your faction.", who); + mplayer.msg("%s disbanded your faction.", who); } else { - uplayer.msg("%s disbanded the faction %s.", who, faction.getName(uplayer)); + mplayer.msg("%s disbanded the faction %s.", who, faction.getName(mplayer)); } } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsFaction.java b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsFaction.java index 2db23aca..16a8809a 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsFaction.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsFaction.java @@ -145,7 +145,7 @@ public class CmdFactionsFaction extends FCommand List followerNamesOnline = new ArrayList(); List followerNamesOffline = new ArrayList(); - List followers = faction.getUPlayers(); + List followers = faction.getMPlayers(); Collections.sort(followers, PlayerRoleComparator.get()); for (MPlayer follower : followers) diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsInvite.java b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsInvite.java index 42102d97..1c81db6b 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsInvite.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsInvite.java @@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.FPerm; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARUPlayer; +import com.massivecraft.factions.cmd.arg.ARMPlayer; import com.massivecraft.factions.cmd.req.ReqHasFaction; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.event.EventFactionsInvitedChange; @@ -40,16 +40,16 @@ public class CmdFactionsInvite extends FCommand public void perform() { // Args - MPlayer uplayer = this.arg(0, ARUPlayer.getAny()); - if (uplayer == null) return; + MPlayer mplayer = this.arg(0, ARMPlayer.getAny()); + if (mplayer == null) return; - Boolean newInvited = this.arg(1, ARBoolean.get(), !usenderFaction.isInvited(uplayer)); + Boolean newInvited = this.arg(1, ARBoolean.get(), !usenderFaction.isInvited(mplayer)); if (newInvited == null) return; // Allready member? - if (uplayer.getFaction() == usenderFaction) + if (mplayer.getFaction() == usenderFaction) { - msg("%s is already a member of %s", uplayer.getName(), usenderFaction.getName()); + msg("%s is already a member of %s", mplayer.getName(), usenderFaction.getName()); msg("You might want to: " + Factions.get().getOuterCmdFactions().cmdFactionsKick.getUseageTemplate(false)); return; } @@ -58,24 +58,24 @@ public class CmdFactionsInvite extends FCommand if ( ! FPerm.INVITE.has(usender, usenderFaction, true)) return; // Event - EventFactionsInvitedChange event = new EventFactionsInvitedChange(sender, uplayer, usenderFaction, newInvited); + EventFactionsInvitedChange event = new EventFactionsInvitedChange(sender, mplayer, usenderFaction, newInvited); event.run(); if (event.isCancelled()) return; newInvited = event.isNewInvited(); // Apply - usenderFaction.setInvited(uplayer, newInvited); + usenderFaction.setInvited(mplayer, newInvited); // Inform if (newInvited) { - uplayer.msg("%s invited you to %s", usender.describeTo(uplayer, true), usenderFaction.describeTo(uplayer)); - usenderFaction.msg("%s invited %s to your faction.", usender.describeTo(usenderFaction, true), uplayer.describeTo(usenderFaction)); + mplayer.msg("%s invited you to %s", usender.describeTo(mplayer, true), usenderFaction.describeTo(mplayer)); + usenderFaction.msg("%s invited %s to your faction.", usender.describeTo(usenderFaction, true), mplayer.describeTo(usenderFaction)); } else { - uplayer.msg("%s revoked your invitation to %s.", usender.describeTo(uplayer), usenderFaction.describeTo(uplayer)); - usenderFaction.msg("%s revoked %s's invitation.", usender.describeTo(usenderFaction), uplayer.describeTo(usenderFaction)); + mplayer.msg("%s revoked your invitation to %s.", usender.describeTo(mplayer), usenderFaction.describeTo(mplayer)); + usenderFaction.msg("%s revoked %s's invitation.", usender.describeTo(usenderFaction), mplayer.describeTo(usenderFaction)); } } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsJoin.java b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsJoin.java index d10fbc28..a6bbc357 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsJoin.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsJoin.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARUPlayer; +import com.massivecraft.factions.cmd.arg.ARMPlayer; import com.massivecraft.factions.cmd.arg.ARFaction; import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.MPlayer; @@ -42,11 +42,11 @@ public class CmdFactionsJoin extends FCommand Faction faction = this.arg(0, ARFaction.get()); if (faction == null) return; - MPlayer uplayer = this.arg(1, ARUPlayer.getAny(), usender); - if (uplayer == null) return; - Faction uplayerFaction = uplayer.getFaction(); + MPlayer mplayer = this.arg(1, ARMPlayer.getAny(), usender); + if (mplayer == null) return; + Faction mplayerFaction = mplayer.getFaction(); - boolean samePlayer = uplayer == usender; + boolean samePlayer = mplayer == usender; // Validate if (!samePlayer && ! Perm.JOIN_OTHERS.has(sender, false)) @@ -55,36 +55,36 @@ public class CmdFactionsJoin extends FCommand return; } - if (faction == uplayerFaction) + if (faction == mplayerFaction) { - msg("%s %s already a member of %s.", uplayer.describeTo(usender, true), (samePlayer ? "are" : "is"), faction.getName(usender)); + msg("%s %s already a member of %s.", mplayer.describeTo(usender, true), (samePlayer ? "are" : "is"), faction.getName(usender)); return; } - if (MConf.get().factionMemberLimit > 0 && faction.getUPlayers().size() >= MConf.get().factionMemberLimit) + if (MConf.get().factionMemberLimit > 0 && faction.getMPlayers().size() >= MConf.get().factionMemberLimit) { - msg(" ! The faction %s is at the limit of %d members, so %s cannot currently join.", faction.getName(usender), MConf.get().factionMemberLimit, uplayer.describeTo(usender, false)); + msg(" ! The faction %s is at the limit of %d members, so %s cannot currently join.", faction.getName(usender), MConf.get().factionMemberLimit, mplayer.describeTo(usender, false)); return; } - if (uplayerFaction.isNormal()) + if (mplayerFaction.isNormal()) { - msg("%s must leave %s current faction first.", uplayer.describeTo(usender, true), (samePlayer ? "your" : "their")); + msg("%s must leave %s current faction first.", mplayer.describeTo(usender, true), (samePlayer ? "your" : "their")); return; } - if (!MConf.get().canLeaveWithNegativePower && uplayer.getPower() < 0) + if (!MConf.get().canLeaveWithNegativePower && mplayer.getPower() < 0) { - msg("%s cannot join a faction with a negative power level.", uplayer.describeTo(usender, true)); + msg("%s cannot join a faction with a negative power level.", mplayer.describeTo(usender, true)); return; } - if( ! (faction.isOpen() || faction.isInvited(uplayer) || usender.isUsingAdminMode() || Perm.JOIN_ANY.has(sender, false))) + if( ! (faction.isOpen() || faction.isInvited(mplayer) || usender.isUsingAdminMode() || Perm.JOIN_ANY.has(sender, false))) { msg("This faction requires invitation."); if (samePlayer) { - faction.msg("%s tried to join your faction.", uplayer.describeTo(faction, true)); + faction.msg("%s tried to join your faction.", mplayer.describeTo(faction, true)); } return; } @@ -97,27 +97,27 @@ public class CmdFactionsJoin extends FCommand // Inform if (!samePlayer) { - uplayer.msg("%s moved you into the faction %s.", usender.describeTo(uplayer, true), faction.getName(uplayer)); + mplayer.msg("%s moved you into the faction %s.", usender.describeTo(mplayer, true), faction.getName(mplayer)); } - faction.msg("%s joined your faction.", uplayer.describeTo(faction, true)); - usender.msg("%s successfully joined %s.", uplayer.describeTo(usender, true), faction.getName(usender)); + faction.msg("%s joined your faction.", mplayer.describeTo(faction, true)); + usender.msg("%s successfully joined %s.", mplayer.describeTo(usender, true), faction.getName(usender)); // Apply - uplayer.resetFactionData(); - uplayer.setFaction(faction); + mplayer.resetFactionData(); + mplayer.setFaction(faction); - faction.setInvited(uplayer, false); + faction.setInvited(mplayer, false); // Derplog if (MConf.get().logFactionJoin) { if (samePlayer) { - Factions.get().log(Txt.parse("%s joined the faction %s.", uplayer.getName(), faction.getName())); + Factions.get().log(Txt.parse("%s joined the faction %s.", mplayer.getName(), faction.getName())); } else { - Factions.get().log(Txt.parse("%s moved the player %s into the faction %s.", usender.getName(), uplayer.getName(), faction.getName())); + Factions.get().log(Txt.parse("%s moved the player %s into the faction %s.", usender.getName(), mplayer.getName(), faction.getName())); } } } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsKick.java b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsKick.java index 897e180f..c08423fd 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsKick.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsKick.java @@ -4,7 +4,7 @@ import com.massivecraft.factions.FPerm; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; import com.massivecraft.factions.Rel; -import com.massivecraft.factions.cmd.arg.ARUPlayer; +import com.massivecraft.factions.cmd.arg.ARMPlayer; import com.massivecraft.factions.entity.FactionColl; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.Faction; @@ -40,58 +40,58 @@ public class CmdFactionsKick extends FCommand public void perform() { // Arg - MPlayer uplayer = this.arg(0, ARUPlayer.getAny()); - if (uplayer == null) return; + MPlayer mplayer = this.arg(0, ARMPlayer.getAny()); + if (mplayer == null) return; // Validate - if (usender == uplayer) + if (usender == mplayer) { msg("You cannot kick yourself."); msg("You might want to: %s", Factions.get().getOuterCmdFactions().cmdFactionsLeave.getUseageTemplate(false)); return; } - if (uplayer.getRole() == Rel.LEADER && !(this.senderIsConsole || usender.isUsingAdminMode())) + if (mplayer.getRole() == Rel.LEADER && !(this.senderIsConsole || usender.isUsingAdminMode())) { msg("The leader can not be kicked."); return; } - if ( ! MConf.get().canLeaveWithNegativePower && uplayer.getPower() < 0) + if ( ! MConf.get().canLeaveWithNegativePower && mplayer.getPower() < 0) { msg("You cannot kick that member until their power is positive."); return; } // FPerm - Faction uplayerFaction = uplayer.getFaction(); - if (!FPerm.KICK.has(usender, uplayerFaction, true)) return; + Faction mplayerFaction = mplayer.getFaction(); + if (!FPerm.KICK.has(usender, mplayerFaction, true)) return; // Event - EventFactionsMembershipChange event = new EventFactionsMembershipChange(sender, uplayer, FactionColl.get().getNone(), MembershipChangeReason.KICK); + EventFactionsMembershipChange event = new EventFactionsMembershipChange(sender, mplayer, FactionColl.get().getNone(), MembershipChangeReason.KICK); event.run(); if (event.isCancelled()) return; // Inform - uplayerFaction.msg("%s kicked %s from the faction! :O", usender.describeTo(uplayerFaction, true), uplayer.describeTo(uplayerFaction, true)); - uplayer.msg("%s kicked you from %s! :O", usender.describeTo(uplayer, true), uplayerFaction.describeTo(uplayer)); - if (uplayerFaction != usenderFaction) + mplayerFaction.msg("%s kicked %s from the faction! :O", usender.describeTo(mplayerFaction, true), mplayer.describeTo(mplayerFaction, true)); + mplayer.msg("%s kicked you from %s! :O", usender.describeTo(mplayer, true), mplayerFaction.describeTo(mplayer)); + if (mplayerFaction != usenderFaction) { - usender.msg("You kicked %s from the faction %s!", uplayer.describeTo(usender), uplayerFaction.describeTo(usender)); + usender.msg("You kicked %s from the faction %s!", mplayer.describeTo(usender), mplayerFaction.describeTo(usender)); } if (MConf.get().logFactionKick) { - Factions.get().log(usender.getDisplayName(IdUtil.getConsole()) + " kicked " + uplayer.getName() + " from the faction " + uplayerFaction.getName()); + Factions.get().log(usender.getDisplayName(IdUtil.getConsole()) + " kicked " + mplayer.getName() + " from the faction " + mplayerFaction.getName()); } // Apply - if (uplayer.getRole() == Rel.LEADER) + if (mplayer.getRole() == Rel.LEADER) { - uplayerFaction.promoteNewLeader(); + mplayerFaction.promoteNewLeader(); } - uplayerFaction.setInvited(uplayer, false); - uplayer.resetFactionData(); + mplayerFaction.setInvited(mplayer, false); + mplayer.resetFactionData(); } } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsLeader.java b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsLeader.java index e6f78f65..59eedc58 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsLeader.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsLeader.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; import com.massivecraft.factions.Rel; -import com.massivecraft.factions.cmd.arg.ARUPlayer; +import com.massivecraft.factions.cmd.arg.ARMPlayer; import com.massivecraft.factions.cmd.arg.ARFaction; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.Faction; @@ -38,7 +38,7 @@ public class CmdFactionsLeader extends FCommand @Override public void perform() { - MPlayer newLeader = this.arg(0, ARUPlayer.getAny()); + MPlayer newLeader = this.arg(0, ARMPlayer.getAny()); if (newLeader == null) return; Faction targetFaction = this.arg(1, ARFaction.get(), usenderFaction); @@ -46,7 +46,7 @@ public class CmdFactionsLeader extends FCommand MPlayer targetFactionCurrentLeader = targetFaction.getLeader(); - // We now have uplayer and the target faction + // We now have mplayer and the target faction if (this.senderIsConsole || usender.isUsingAdminMode() || Perm.LEADER_ANY.has(sender, false)) { // Do whatever you wish @@ -100,9 +100,9 @@ public class CmdFactionsLeader extends FCommand msg("You have promoted %s to the position of faction leader.", newLeader.describeTo(usender, true)); // Inform all players - for (MPlayer uplayer : MPlayerColl.get().getAllOnline()) + for (MPlayer mplayer : MPlayerColl.get().getAllOnline()) { - uplayer.msg("%s gave %s the leadership of %s.", senderIsConsole ? "A server admin" : RelationUtil.describeThatToMe(usender, uplayer, true), newLeader.describeTo(uplayer), targetFaction.describeTo(uplayer)); + mplayer.msg("%s gave %s the leadership of %s.", senderIsConsole ? "A server admin" : RelationUtil.describeThatToMe(usender, mplayer, true), newLeader.describeTo(mplayer), targetFaction.describeTo(mplayer)); } } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsList.java b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsList.java index 9050f99c..07bb5785 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsList.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsList.java @@ -63,13 +63,13 @@ public class CmdFactionsList extends FCommand { if (faction.isNone()) { - lines.add(Txt.parse("Factionless %d online", FactionColl.get().getNone().getUPlayersWhereOnline(true).size())); + lines.add(Txt.parse("Factionless %d online", FactionColl.get().getNone().getMPlayersWhereOnline(true).size())); continue; } lines.add(Txt.parse("%s %d/%d online, %d/%d/%d", faction.getName(usender), - faction.getUPlayersWhereOnline(true).size(), - faction.getUPlayers().size(), + faction.getMPlayersWhereOnline(true).size(), + faction.getMPlayers().size(), faction.getLandCount(), faction.getPowerRounded(), faction.getPowerMaxRounded()) diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFp.java b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFp.java index 380111b8..e73d0fab 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFp.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFp.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARUPlayer; +import com.massivecraft.factions.cmd.arg.ARMPlayer; import com.massivecraft.factions.cmd.arg.ARFaction; import com.massivecraft.factions.cmd.req.ReqBankCommandsEnabled; import com.massivecraft.factions.entity.MPlayer; @@ -51,7 +51,7 @@ public class CmdFactionsMoneyTransferFp extends FCommand Faction from = this.arg(1, ARFaction.get()); if (from == null) return; - MPlayer to = this.arg(2, ARUPlayer.getAny()); + MPlayer to = this.arg(2, ARMPlayer.getAny()); if (to == null) return; boolean success = Econ.transferMoney(usender, from, to, amount); diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferPf.java b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferPf.java index 5c9f334d..698cfb6c 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferPf.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferPf.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARUPlayer; +import com.massivecraft.factions.cmd.arg.ARMPlayer; import com.massivecraft.factions.cmd.arg.ARFaction; import com.massivecraft.factions.cmd.req.ReqBankCommandsEnabled; import com.massivecraft.factions.entity.MPlayer; @@ -48,7 +48,7 @@ public class CmdFactionsMoneyTransferPf extends FCommand Double amount = this.arg(0, ARDouble.get()); if (amount == null) return; - MPlayer from = this.arg(1, ARUPlayer.getAny()); + MPlayer from = this.arg(1, ARMPlayer.getAny()); if (from == null) return; Faction to = this.arg(2, ARFaction.get()); diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsOfficer.java b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsOfficer.java index ac0714f3..6997de77 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsOfficer.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsOfficer.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; import com.massivecraft.factions.Rel; -import com.massivecraft.factions.cmd.arg.ARUPlayer; +import com.massivecraft.factions.cmd.arg.ARMPlayer; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; @@ -32,7 +32,7 @@ public class CmdFactionsOfficer extends FCommand @Override public void perform() { - MPlayer you = this.arg(0, ARUPlayer.getAny()); + MPlayer you = this.arg(0, ARMPlayer.getAny()); if (you == null) return; boolean permAny = Perm.OFFICER_ANY.has(sender, false); diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsPlayer.java b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsPlayer.java index 9c2134cf..f4fa28e0 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsPlayer.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsPlayer.java @@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd; import java.util.LinkedHashMap; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARUPlayer; +import com.massivecraft.factions.cmd.arg.ARMPlayer; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.massivecore.Progressbar; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; @@ -37,24 +37,24 @@ public class CmdFactionsPlayer extends FCommand public void perform() { // Args - MPlayer uplayer = this.arg(0, ARUPlayer.getAny(), usender); - if (uplayer == null) return; + MPlayer mplayer = this.arg(0, ARMPlayer.getAny(), usender); + if (mplayer == null) return; // INFO: Title - msg(Txt.titleize(Txt.upperCaseFirst(uplayer.getUniverse()) + " Player " + uplayer.describeTo(usender))); + msg(Txt.titleize(Txt.upperCaseFirst(mplayer.getUniverse()) + " Player " + mplayer.describeTo(usender))); // INFO: Power (as progress bar) - double progressbarQuota = uplayer.getPower() / uplayer.getPowerMax(); - int progressbarWidth = (int) Math.round(uplayer.getPowerMax() / uplayer.getPowerMaxUniversal() * 100); + double progressbarQuota = mplayer.getPower() / mplayer.getPowerMax(); + int progressbarWidth = (int) Math.round(mplayer.getPowerMax() / mplayer.getPowerMaxUniversal() * 100); msg("Power: %s", Progressbar.HEALTHBAR_CLASSIC.withQuota(progressbarQuota).withWidth(progressbarWidth).render()); // INFO: Power (as digits) - msg("Power: %.2f / %.2f", uplayer.getPower(), uplayer.getPowerMax()); + msg("Power: %.2f / %.2f", mplayer.getPower(), mplayer.getPowerMax()); // INFO: Power Boost - if (uplayer.hasPowerBoost()) + if (mplayer.hasPowerBoost()) { - double powerBoost = uplayer.getPowerBoost(); + double powerBoost = mplayer.getPowerBoost(); String powerBoostType = (powerBoost > 0 ? "bonus" : "penalty"); msg("Power Boost: %f (a manually granted %s)", powerBoost, powerBoostType); } @@ -63,20 +63,20 @@ public class CmdFactionsPlayer extends FCommand // If the player is not at maximum we wan't to display how much time left. String stringTillMax = ""; - double powerTillMax = uplayer.getPowerMax() - uplayer.getPower(); + double powerTillMax = mplayer.getPowerMax() - mplayer.getPower(); if (powerTillMax > 0) { - long millisTillMax = (long) (powerTillMax * TimeUnit.MILLIS_PER_HOUR / uplayer.getPowerPerHour()); + long millisTillMax = (long) (powerTillMax * TimeUnit.MILLIS_PER_HOUR / mplayer.getPowerPerHour()); LinkedHashMap unitcountsTillMax = TimeDiffUtil.unitcounts(millisTillMax, TimeUnit.getAllButMillis()); unitcountsTillMax = TimeDiffUtil.limit(unitcountsTillMax, 2); String unitcountsTillMaxFormated = TimeDiffUtil.formatedVerboose(unitcountsTillMax, ""); stringTillMax = Txt.parse(" (%s left till max)", unitcountsTillMaxFormated); } - msg("Power per Hour: %.2f%s", uplayer.getPowerPerHour(), stringTillMax); + msg("Power per Hour: %.2f%s", mplayer.getPowerPerHour(), stringTillMax); // INFO: Power per Death - msg("Power per Death: %.2f", uplayer.getPowerPerDeath()); + msg("Power per Death: %.2f", mplayer.getPowerPerDeath()); } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java index 286ea451..90eddd09 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARUPlayer; +import com.massivecraft.factions.cmd.arg.ARMPlayer; import com.massivecraft.factions.cmd.arg.ARFaction; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.Faction; @@ -56,7 +56,7 @@ public class CmdFactionsPowerBoost extends FCommand if (doPlayer) { - MPlayer targetPlayer = this.arg(1, ARUPlayer.getAny()); + MPlayer targetPlayer = this.arg(1, ARMPlayer.getAny()); if (targetPlayer == null) return; targetPlayer.setPowerBoost(targetPower); diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsPromote.java b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsPromote.java index 1be18a96..67472540 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsPromote.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsPromote.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; import com.massivecraft.factions.Rel; -import com.massivecraft.factions.cmd.arg.ARUPlayer; +import com.massivecraft.factions.cmd.arg.ARMPlayer; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.massivecore.cmd.req.ReqHasPerm; @@ -35,7 +35,7 @@ public class CmdFactionsPromote extends FCommand @Override public void perform() { - MPlayer you = this.arg(0, ARUPlayer.getAny()); + MPlayer you = this.arg(0, ARMPlayer.getAny()); if (you == null) return; if (you.getFaction() != usenderFaction) diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsTitle.java b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsTitle.java index c781f716..d4aa0dbe 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdFactionsTitle.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdFactionsTitle.java @@ -4,7 +4,7 @@ import org.bukkit.ChatColor; import com.massivecraft.factions.Perm; import com.massivecraft.factions.Rel; -import com.massivecraft.factions.cmd.arg.ARUPlayer; +import com.massivecraft.factions.cmd.arg.ARMPlayer; import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.event.EventFactionsTitleChange; @@ -40,7 +40,7 @@ public class CmdFactionsTitle extends FCommand public void perform() { // Args - MPlayer you = this.arg(0, ARUPlayer.getAny()); + MPlayer you = this.arg(0, ARMPlayer.getAny()); if (you == null) return; String newTitle = this.argConcatFrom(1, ARString.get(), ""); diff --git a/src/main/java/com/massivecraft/factions/cmd/arg/ARFaction.java b/src/main/java/com/massivecraft/factions/cmd/arg/ARFaction.java index 7980c588..cbfe2818 100644 --- a/src/main/java/com/massivecraft/factions/cmd/arg/ARFaction.java +++ b/src/main/java/com/massivecraft/factions/cmd/arg/ARFaction.java @@ -36,12 +36,12 @@ public class ARFaction extends ArgReaderAbstract result.setResult(FactionColl.get().getBestNameMatch(str)); if (result.hasResult()) return result; - // UPlayer Name Exact + // MPlayer Name Exact String id = IdUtil.getId(str); - MPlayer uplayer = MPlayer.get(id); - if (uplayer != null) + MPlayer mplayer = MPlayer.get(id); + if (mplayer != null) { - result.setResult(uplayer.getFaction()); + result.setResult(mplayer.getFaction()); return result; } diff --git a/src/main/java/com/massivecraft/factions/cmd/arg/ARUPlayer.java b/src/main/java/com/massivecraft/factions/cmd/arg/ARMPlayer.java similarity index 91% rename from src/main/java/com/massivecraft/factions/cmd/arg/ARUPlayer.java rename to src/main/java/com/massivecraft/factions/cmd/arg/ARMPlayer.java index 36685cae..62c7156a 100644 --- a/src/main/java/com/massivecraft/factions/cmd/arg/ARUPlayer.java +++ b/src/main/java/com/massivecraft/factions/cmd/arg/ARMPlayer.java @@ -4,7 +4,7 @@ import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.MPlayerColl; import com.massivecraft.massivecore.cmd.arg.ArgReader; -public class ARUPlayer +public class ARMPlayer { // -------------------------------------------- // // INSTANCE diff --git a/src/main/java/com/massivecraft/factions/cmd/req/ReqRoleIsAtLeast.java b/src/main/java/com/massivecraft/factions/cmd/req/ReqRoleIsAtLeast.java index 3d04116c..cf9d1e47 100644 --- a/src/main/java/com/massivecraft/factions/cmd/req/ReqRoleIsAtLeast.java +++ b/src/main/java/com/massivecraft/factions/cmd/req/ReqRoleIsAtLeast.java @@ -33,8 +33,8 @@ public class ReqRoleIsAtLeast extends ReqAbstract @Override public boolean apply(CommandSender sender, MassiveCommand command) { - MPlayer uplayer = MPlayer.get(sender); - return uplayer.getRole().isAtLeast(this.rel); + MPlayer mplayer = MPlayer.get(sender); + return mplayer.getRole().isAtLeast(this.rel); } @Override diff --git a/src/main/java/com/massivecraft/factions/entity/Board.java b/src/main/java/com/massivecraft/factions/entity/Board.java index cc78077c..2e839bc0 100644 --- a/src/main/java/com/massivecraft/factions/entity/Board.java +++ b/src/main/java/com/massivecraft/factions/entity/Board.java @@ -99,7 +99,7 @@ public class Board extends Entity implements BoardInterface { if (ps == null) return null; TerritoryAccess ta = this.getTerritoryAccessAt(ps); - return ta.getHostFaction(this); + return ta.getHostFaction(); } // SET diff --git a/src/main/java/com/massivecraft/factions/entity/Faction.java b/src/main/java/com/massivecraft/factions/entity/Faction.java index 520d4954..d13b2815 100644 --- a/src/main/java/com/massivecraft/factions/entity/Faction.java +++ b/src/main/java/com/massivecraft/factions/entity/Faction.java @@ -407,9 +407,9 @@ public class Faction extends Entity implements EconomyParticipator return this.getInvitedPlayerIds().contains(playerId); } - public boolean isInvited(MPlayer uplayer) + public boolean isInvited(MPlayer mplayer) { - return this.isInvited(uplayer.getId()); + return this.isInvited(mplayer.getId()); } public boolean setInvited(String playerId, boolean invited) @@ -429,9 +429,9 @@ public class Faction extends Entity implements EconomyParticipator } - public void setInvited(MPlayer uplayer, boolean invited) + public void setInvited(MPlayer mplayer, boolean invited) { - this.setInvited(uplayer.getId(), invited); + this.setInvited(mplayer.getId(), invited); } // -------------------------------------------- // @@ -774,9 +774,9 @@ public class Faction extends Entity implements EconomyParticipator if (this.getFlag(FFlag.INFPOWER)) return 999999; double ret = 0; - for (MPlayer uplayer : this.getUPlayers()) + for (MPlayer mplayer : this.getMPlayers()) { - ret += uplayer.getPower(); + ret += mplayer.getPower(); } double factionPowerMax = MConf.get().factionPowerMax; @@ -795,9 +795,9 @@ public class Faction extends Entity implements EconomyParticipator if (this.getFlag(FFlag.INFPOWER)) return 999999; double ret = 0; - for (MPlayer uplayer : this.getUPlayers()) + for (MPlayer mplayer : this.getMPlayers()) { - ret += uplayer.getPowerMax(); + ret += mplayer.getPowerMax(); } double factionPowerMax = MConf.get().factionPowerMax; @@ -836,13 +836,13 @@ public class Faction extends Entity implements EconomyParticipator } // -------------------------------------------- // - // FOREIGN KEY: UPLAYER + // FOREIGN KEY: MPLAYER // -------------------------------------------- // - protected transient List uplayers = new ArrayList(); - public void reindexUPlayers() + protected transient List mplayers = new ArrayList(); + public void reindexMPlayers() { - this.uplayers.clear(); + this.mplayers.clear(); String factionId = this.getId(); if (factionId == null) return; @@ -850,42 +850,42 @@ public class Faction extends Entity implements EconomyParticipator for (MPlayer mplayer : MPlayerColl.get().getAll()) { if (!MUtil.equals(factionId, mplayer.getFactionId())) continue; - this.uplayers.add(mplayer); + this.mplayers.add(mplayer); } } // TODO: Even though this check method removeds the invalid entries it's not a true solution. - // TODO: Find the bug causing non-attached UPlayers to be present in the index. - private void checkUPlayerIndex() + // TODO: Find the bug causing non-attached MPlayers to be present in the index. + private void checkMPlayerIndex() { - Iterator iter = this.uplayers.iterator(); + Iterator iter = this.mplayers.iterator(); while (iter.hasNext()) { - MPlayer uplayer = iter.next(); - if (!uplayer.attached()) + MPlayer mplayer = iter.next(); + if (!mplayer.attached()) { - String msg = Txt.parse("WARN: Faction %s aka %s had unattached uplayer in index:", this.getName(), this.getId()); + String msg = Txt.parse("WARN: Faction %s aka %s had unattached mplayer in index:", this.getName(), this.getId()); Factions.get().log(msg); - Factions.get().log(Factions.get().gson.toJson(uplayer)); + Factions.get().log(Factions.get().gson.toJson(mplayer)); iter.remove(); } } } - public List getUPlayers() + public List getMPlayers() { - this.checkUPlayerIndex(); - return new ArrayList(this.uplayers); + this.checkMPlayerIndex(); + return new ArrayList(this.mplayers); } - public List getUPlayersWhereOnline(boolean online) + public List getMPlayersWhereOnline(boolean online) { - List ret = this.getUPlayers(); + List ret = this.getMPlayers(); Iterator iter = ret.iterator(); while (iter.hasNext()) { - MPlayer uplayer = iter.next(); - if (uplayer.isOnline() != online) + MPlayer mplayer = iter.next(); + if (mplayer.isOnline() != online) { iter.remove(); } @@ -893,14 +893,14 @@ public class Faction extends Entity implements EconomyParticipator return ret; } - public List getUPlayersWhereRole(Rel role) + public List getMPlayersWhereRole(Rel role) { - List ret = this.getUPlayers(); + List ret = this.getMPlayers(); Iterator iter = ret.iterator(); while (iter.hasNext()) { - MPlayer uplayer = iter.next(); - if (uplayer.getRole() != role) + MPlayer mplayer = iter.next(); + if (mplayer.getRole() != role) { iter.remove(); } @@ -910,14 +910,14 @@ public class Faction extends Entity implements EconomyParticipator public MPlayer getLeader() { - List ret = this.getUPlayers(); + List ret = this.getMPlayers(); Iterator iter = ret.iterator(); while (iter.hasNext()) { - MPlayer uplayer = iter.next(); - if (uplayer.getRole() == Rel.LEADER) + MPlayer mplayer = iter.next(); + if (mplayer.getRole() == Rel.LEADER) { - return uplayer; + return mplayer; } } return null; @@ -928,9 +928,8 @@ public class Faction extends Entity implements EconomyParticipator List ret = new ArrayList(); for (CommandSender player : IdUtil.getOnlineSenders()) { - MPlayer uplayer = MPlayer.get(player); - if (!MUtil.equals(uplayer.getUniverse(), this.getUniverse())) continue; - if (uplayer.getFaction() != this) continue; + MPlayer mplayer = MPlayer.get(player); + if (mplayer.getFaction() != this) continue; ret.add(player); } return ret; @@ -941,9 +940,8 @@ public class Faction extends Entity implements EconomyParticipator List ret = new ArrayList(); for (Player player : Bukkit.getOnlinePlayers()) { - MPlayer uplayer = MPlayer.get(player); - if (!MUtil.equals(uplayer.getUniverse(), this.getUniverse())) continue; - if (uplayer.getFaction() != this) continue; + MPlayer mplayer = MPlayer.get(player); + if (mplayer.getFaction() != this) continue; ret.add(player); } return ret; @@ -958,10 +956,10 @@ public class Faction extends Entity implements EconomyParticipator MPlayer oldLeader = this.getLeader(); // get list of officers, or list of normal members if there are no officers - List replacements = this.getUPlayersWhereRole(Rel.OFFICER); + List replacements = this.getMPlayersWhereRole(Rel.OFFICER); if (replacements == null || replacements.isEmpty()) { - replacements = this.getUPlayersWhereRole(Rel.MEMBER); + replacements = this.getMPlayersWhereRole(Rel.MEMBER); } if (replacements == null || replacements.isEmpty()) @@ -1007,19 +1005,19 @@ public class Faction extends Entity implements EconomyParticipator // FACTION ONLINE STATE // -------------------------------------------- // - public boolean isAllUPlayersOffline() + public boolean isAllMPlayersOffline() { - return this.getUPlayersWhereOnline(true).size() == 0; + return this.getMPlayersWhereOnline(true).size() == 0; } - public boolean isAnyUPlayersOnline() + public boolean isAnyMPlayersOnline() { - return !this.isAllUPlayersOffline(); + return !this.isAllMPlayersOffline(); } public boolean isFactionConsideredOffline() { - return this.isAllUPlayersOffline(); + return this.isAllMPlayersOffline(); } public boolean isFactionConsideredOnline() diff --git a/src/main/java/com/massivecraft/factions/entity/FactionColl.java b/src/main/java/com/massivecraft/factions/entity/FactionColl.java index 65e6946d..c2e89eda 100644 --- a/src/main/java/com/massivecraft/factions/entity/FactionColl.java +++ b/src/main/java/com/massivecraft/factions/entity/FactionColl.java @@ -50,7 +50,7 @@ public class FactionColl extends Coll // Example Reason: When creating the special factions for the first time "createSpecialFactions" a clean would be triggered otherwise. if (ret == null && Factions.get().isDatabaseInitialized()) { - String message = Txt.parse("Non existing factionId %s requested. Cleaning all boards and uplayers.", this.fixId(oid)); + String message = Txt.parse("Non existing factionId %s requested. Cleaning all boards and mplayers.", this.fixId(oid)); Factions.get().log(message); BoardColl.get().clean(); @@ -64,11 +64,11 @@ public class FactionColl extends Coll // INDEX // -------------------------------------------- // - public void reindexUPlayers() + public void reindexMPlayers() { for (Faction faction : this.getAll()) { - faction.reindexUPlayers(); + faction.reindexMPlayers(); } } @@ -199,7 +199,7 @@ public class FactionColl extends Coll int landCount = faction.getLandCount(); if (!faction.getFlag(FFlag.PEACEFUL) && landCount > 0) { - List players = faction.getUPlayers(); + List players = faction.getMPlayers(); int playerCount = players.size(); double reward = econLandReward * landCount / playerCount; for (MPlayer player : players) @@ -320,11 +320,11 @@ public class FactionColl extends Coll // INDEX // -------------------------------------------- // - public void reindexUPlayers() + public void reindexMPlayers() { for (FactionColl coll : this.getColls()) { - coll.reindexUPlayers(); + coll.reindexMPlayers(); } } */ diff --git a/src/main/java/com/massivecraft/factions/entity/MPlayer.java b/src/main/java/com/massivecraft/factions/entity/MPlayer.java index 440972a1..629fcd2b 100644 --- a/src/main/java/com/massivecraft/factions/entity/MPlayer.java +++ b/src/main/java/com/massivecraft/factions/entity/MPlayer.java @@ -77,7 +77,7 @@ public class MPlayer extends SenderEntity implements EconomyParticipato // ... update the index. Faction faction = this.getFaction(); - faction.uplayers.add(this); + faction.mplayers.add(this); //Factions.get().log(Txt.parse("postAttach added %s aka %s to %s aka %s.", id, Mixin.getDisplayName(id), faction.getId(), faction.getName())); } @@ -90,7 +90,7 @@ public class MPlayer extends SenderEntity implements EconomyParticipato // ... update the index. Faction faction = this.getFaction(); - faction.uplayers.remove(this); + faction.mplayers.remove(this); //Factions.get().log(Txt.parse("preDetach removed %s aka %s to %s aka %s.", id, Mixin.getDisplayName(id), faction.getId(), faction.getName())); } @@ -140,7 +140,7 @@ public class MPlayer extends SenderEntity implements EconomyParticipato // Null means false private Boolean usingAdminMode = null; - // The id for the faction this uplayer is currently autoclaiming for. + // The id for the faction this player is currently autoclaiming for. // NOTE: This field will not be saved to the database ever. // Null means the player isn't auto claiming. private transient Faction autoClaimFaction = null; @@ -214,8 +214,8 @@ public class MPlayer extends SenderEntity implements EconomyParticipato Faction oldFaction = Faction.get(oldFactionId); Faction faction = this.getFaction(); - if (oldFaction != null) oldFaction.uplayers.remove(this); - if (faction != null) faction.uplayers.add(this); + if (oldFaction != null) oldFaction.mplayers.remove(this); + if (faction != null) faction.mplayers.add(this); String oldFactionIdDesc = "NULL"; String oldFactionNameDesc = "NULL"; @@ -556,9 +556,9 @@ public class MPlayer extends SenderEntity implements EconomyParticipato { return this.getNameAndTitle(this.getColorTo(faction).toString()); } - public String getNameAndTitle(MPlayer uplayer) + public String getNameAndTitle(MPlayer mplayer) { - return this.getNameAndTitle(this.getColorTo(uplayer).toString()); + return this.getNameAndTitle(this.getColorTo(mplayer).toString()); } // -------------------------------------------- // @@ -637,7 +637,7 @@ public class MPlayer extends SenderEntity implements EconomyParticipato boolean permanent = myFaction.getFlag(FFlag.PERMANENT); - if (myFaction.getUPlayers().size() > 1) + if (myFaction.getMPlayers().size() > 1) { if (!permanent && this.getRole() == Rel.LEADER) { @@ -659,9 +659,9 @@ public class MPlayer extends SenderEntity implements EconomyParticipato if (myFaction.isNormal()) { - for (MPlayer uplayer : myFaction.getUPlayersWhereOnline(true)) + for (MPlayer mplayer : myFaction.getMPlayersWhereOnline(true)) { - uplayer.msg("%s left %s.", this.describeTo(uplayer, true), myFaction.describeTo(uplayer)); + mplayer.msg("%s left %s.", this.describeTo(mplayer, true), myFaction.describeTo(mplayer)); } if (MConf.get().logFactionLeave) @@ -672,7 +672,7 @@ public class MPlayer extends SenderEntity implements EconomyParticipato this.resetFactionData(); - if (myFaction.isNormal() && !permanent && myFaction.getUPlayers().isEmpty()) + if (myFaction.isNormal() && !permanent && myFaction.getMPlayers().isEmpty()) { // Remove this faction for (MPlayer mplayer : MPlayerColl.get().getAllOnline()) @@ -717,7 +717,7 @@ public class MPlayer extends SenderEntity implements EconomyParticipato return false; } - if (newFaction.getUPlayers().size() < mconf.claimsRequireMinFactionMembers) + if (newFaction.getMPlayers().size() < mconf.claimsRequireMinFactionMembers) { msg("Factions must have at least %s members to claim land.", mconf.claimsRequireMinFactionMembers); return false; @@ -804,11 +804,11 @@ public class MPlayer extends SenderEntity implements EconomyParticipato informees.add(this); if (newFaction.isNormal()) { - informees.addAll(newFaction.getUPlayers()); + informees.addAll(newFaction.getMPlayers()); } if (oldFaction.isNormal()) { - informees.addAll(oldFaction.getUPlayers()); + informees.addAll(oldFaction.getMPlayers()); } if (MConf.get().logLandClaims) { diff --git a/src/main/java/com/massivecraft/factions/entity/MPlayerColl.java b/src/main/java/com/massivecraft/factions/entity/MPlayerColl.java index b72b9109..f06289b2 100644 --- a/src/main/java/com/massivecraft/factions/entity/MPlayerColl.java +++ b/src/main/java/com/massivecraft/factions/entity/MPlayerColl.java @@ -30,14 +30,14 @@ public class MPlayerColl extends SenderColl public void clean() { String universe = this.getUniverse(); - for (MPlayer uplayer : this.getAll()) + for (MPlayer mplayer : this.getAll()) { - String factionId = uplayer.getFactionId(); + String factionId = mplayer.getFactionId(); if (FactionColl.get().containsId(factionId)) continue; - uplayer.resetFactionData(); + mplayer.resetFactionData(); - String message = Txt.parse("Reset data for %s in %s universe. Unknown factionId %s", uplayer.getDisplayName(IdUtil.getConsole()), universe, factionId); + String message = Txt.parse("Reset data for %s in %s universe. Unknown factionId %s", mplayer.getDisplayName(IdUtil.getConsole()), universe, factionId); Factions.get().log(message); } } @@ -49,31 +49,31 @@ public class MPlayerColl extends SenderColl long now = System.currentTimeMillis(); double toleranceMillis = MConf.get().removePlayerDataAfterInactiveDays * TimeUnit.MILLIS_PER_DAY; - for (MPlayer uplayer : this.getAll()) + for (MPlayer mplayer : this.getAll()) { - Long lastPlayed = Mixin.getLastPlayed(uplayer.getId()); + Long lastPlayed = Mixin.getLastPlayed(mplayer.getId()); if (lastPlayed == null) continue; - if (uplayer.isOnline()) continue; + if (mplayer.isOnline()) continue; if (now - lastPlayed <= toleranceMillis) continue; if (MConf.get().logFactionLeave || MConf.get().logFactionKick) { - Factions.get().log("Player "+uplayer.getName()+" was auto-removed due to inactivity."); + Factions.get().log("Player "+mplayer.getName()+" was auto-removed due to inactivity."); } // if player is faction leader, sort out the faction since he's going away - if (uplayer.getRole() == Rel.LEADER) + if (mplayer.getRole() == Rel.LEADER) { - Faction faction = uplayer.getFaction(); + Faction faction = mplayer.getFaction(); if (faction != null) { - uplayer.getFaction().promoteNewLeader(); + mplayer.getFaction().promoteNewLeader(); } } - uplayer.leave(); - uplayer.detach(); + mplayer.leave(); + mplayer.detach(); } } @@ -89,18 +89,18 @@ public class MPlayerColl extends SenderColl if ( ! oldFile.exists()) return; // Read the file content through GSON. - Type type = new TypeToken>(){}.getType(); - Map id2uplayer = Factions.get().gson.fromJson(DiscUtil.readCatch(oldFile), type); + Type type = new TypeToken>(){}.getType(); + Map id2mplayer = Factions.get().gson.fromJson(DiscUtil.readCatch(oldFile), type); // The Coll - UPlayerColl coll = this.getForUniverse(MassiveCore.DEFAULT); + MPlayerColl coll = this.getForUniverse(MassiveCore.DEFAULT); // Set the data - for (Entry entry : id2uplayer.entrySet()) + for (Entry entry : id2mplayer.entrySet()) { String playerId = entry.getKey(); - UPlayer uplayer = entry.getValue(); - coll.attach(uplayer, playerId); + MPlayer mplayer = entry.getValue(); + coll.attach(mplayer, playerId); } // Mark as migrated @@ -113,7 +113,7 @@ public class MPlayerColl extends SenderColl public void clean() { - for (UPlayerColl coll : this.getColls()) + for (MPlayerColl coll : this.getColls()) { coll.clean(); } diff --git a/src/main/java/com/massivecraft/factions/event/EventFactionsInvitedChange.java b/src/main/java/com/massivecraft/factions/event/EventFactionsInvitedChange.java index 64c0f9d3..ca9d061a 100644 --- a/src/main/java/com/massivecraft/factions/event/EventFactionsInvitedChange.java +++ b/src/main/java/com/massivecraft/factions/event/EventFactionsInvitedChange.java @@ -20,8 +20,8 @@ public class EventFactionsInvitedChange extends EventFactionsAbstractSender // FIELDS // -------------------------------------------- // - private final MPlayer uplayer; - public MPlayer getUPlayer() { return this.uplayer; } + private final MPlayer mplayer; + public MPlayer getMPlayer() { return this.mplayer; } private final Faction faction; public Faction getFaction() { return this.faction; } @@ -34,10 +34,10 @@ public class EventFactionsInvitedChange extends EventFactionsAbstractSender // CONSTRUCT // -------------------------------------------- // - public EventFactionsInvitedChange(CommandSender sender, MPlayer uplayer, Faction faction, boolean newInvited) + public EventFactionsInvitedChange(CommandSender sender, MPlayer mplayer, Faction faction, boolean newInvited) { super(sender); - this.uplayer = uplayer; + this.mplayer = mplayer; this.faction = faction; this.newInvited = newInvited; } diff --git a/src/main/java/com/massivecraft/factions/event/EventFactionsMembershipChange.java b/src/main/java/com/massivecraft/factions/event/EventFactionsMembershipChange.java index 5c545ac1..94643721 100644 --- a/src/main/java/com/massivecraft/factions/event/EventFactionsMembershipChange.java +++ b/src/main/java/com/massivecraft/factions/event/EventFactionsMembershipChange.java @@ -27,8 +27,8 @@ public class EventFactionsMembershipChange extends EventFactionsAbstractSender super.setCancelled(cancelled); } - private final MPlayer uplayer; - public MPlayer getUPlayer() { return this.uplayer; } + private final MPlayer mplayer; + public MPlayer getMPlayer() { return this.mplayer; } private final Faction newFaction; public Faction getNewFaction() { return this.newFaction; } @@ -40,10 +40,10 @@ public class EventFactionsMembershipChange extends EventFactionsAbstractSender // CONSTRUCT // -------------------------------------------- // - public EventFactionsMembershipChange(CommandSender sender, MPlayer uplayer, Faction newFaction, MembershipChangeReason reason) + public EventFactionsMembershipChange(CommandSender sender, MPlayer mplayer, Faction newFaction, MembershipChangeReason reason) { super(sender); - this.uplayer = uplayer; + this.mplayer = mplayer; this.newFaction = newFaction; this.reason = reason; } diff --git a/src/main/java/com/massivecraft/factions/event/EventFactionsPowerChange.java b/src/main/java/com/massivecraft/factions/event/EventFactionsPowerChange.java index be8efa5f..deb8e93d 100644 --- a/src/main/java/com/massivecraft/factions/event/EventFactionsPowerChange.java +++ b/src/main/java/com/massivecraft/factions/event/EventFactionsPowerChange.java @@ -19,8 +19,8 @@ public class EventFactionsPowerChange extends EventFactionsAbstractSender // FIELDS // -------------------------------------------- // - private final MPlayer uplayer; - public MPlayer getUPlayer() { return this.uplayer; } + private final MPlayer mplayer; + public MPlayer getMPlayer() { return this.mplayer; } private final PowerChangeReason reason; public PowerChangeReason getReason() { return this.reason; } @@ -33,12 +33,12 @@ public class EventFactionsPowerChange extends EventFactionsAbstractSender // CONSTRUCT // -------------------------------------------- // - public EventFactionsPowerChange(CommandSender sender, MPlayer uplayer, PowerChangeReason reason, double newPower) + public EventFactionsPowerChange(CommandSender sender, MPlayer mplayer, PowerChangeReason reason, double newPower) { super(sender); - this.uplayer = uplayer; + this.mplayer = mplayer; this.reason = reason; - this.newPower = uplayer.getLimitedPower(newPower); + this.newPower = mplayer.getLimitedPower(newPower); } // -------------------------------------------- // diff --git a/src/main/java/com/massivecraft/factions/event/EventFactionsTitleChange.java b/src/main/java/com/massivecraft/factions/event/EventFactionsTitleChange.java index 4fa64ca8..981ee4eb 100644 --- a/src/main/java/com/massivecraft/factions/event/EventFactionsTitleChange.java +++ b/src/main/java/com/massivecraft/factions/event/EventFactionsTitleChange.java @@ -19,8 +19,8 @@ public class EventFactionsTitleChange extends EventFactionsAbstractSender // FIELDS // -------------------------------------------- // - private final MPlayer uplayer; - public MPlayer getUPlayer() { return this.uplayer; } + private final MPlayer mplayer; + public MPlayer getMPlayer() { return this.mplayer; } private String newTitle; public String getNewTitle() { return this.newTitle; } @@ -30,10 +30,10 @@ public class EventFactionsTitleChange extends EventFactionsAbstractSender // CONSTRUCT // -------------------------------------------- // - public EventFactionsTitleChange(CommandSender sender, MPlayer uplayer, String newTitle) + public EventFactionsTitleChange(CommandSender sender, MPlayer mplayer, String newTitle) { super(sender); - this.uplayer = uplayer; + this.mplayer = mplayer; this.newTitle = newTitle; } diff --git a/src/main/java/com/massivecraft/factions/integration/Econ.java b/src/main/java/com/massivecraft/factions/integration/Econ.java index 1524fb6c..c67f4d6a 100644 --- a/src/main/java/com/massivecraft/factions/integration/Econ.java +++ b/src/main/java/com/massivecraft/factions/integration/Econ.java @@ -152,9 +152,9 @@ public class Econ } } - public static Set getUPlayers(EconomyParticipator ep) + public static Set getMPlayers(EconomyParticipator ep) { - Set uplayers = new HashSet(); + Set mplayers = new HashSet(); if (ep == null) { @@ -162,22 +162,22 @@ public class Econ } else if (ep instanceof MPlayer) { - uplayers.add((MPlayer)ep); + mplayers.add((MPlayer)ep); } else if (ep instanceof Faction) { - uplayers.addAll(((Faction)ep).getUPlayers()); + mplayers.addAll(((Faction)ep).getMPlayers()); } - return uplayers; + return mplayers; } public static void sendTransferInfo(EconomyParticipator invoker, EconomyParticipator from, EconomyParticipator to, double amount) { Set recipients = new HashSet(); - recipients.addAll(getUPlayers(invoker)); - recipients.addAll(getUPlayers(from)); - recipients.addAll(getUPlayers(to)); + recipients.addAll(getMPlayers(invoker)); + recipients.addAll(getMPlayers(from)); + recipients.addAll(getMPlayers(to)); if (invoker == null) { diff --git a/src/main/java/com/massivecraft/factions/integration/dynmap/EngineDynmap.java b/src/main/java/com/massivecraft/factions/integration/dynmap/EngineDynmap.java index d7dcbb4d..8e0c91df 100644 --- a/src/main/java/com/massivecraft/factions/integration/dynmap/EngineDynmap.java +++ b/src/main/java/com/massivecraft/factions/integration/dynmap/EngineDynmap.java @@ -652,11 +652,11 @@ public class EngineDynmap extends EngineAbstract Set ret = new HashSet(); - for (MPlayer uplayer : faction.getUPlayers()) + for (MPlayer mplayer : faction.getMPlayers()) { // NOTE: We add both UUID and name. This might be a good idea for future proofing. - ret.add(uplayer.getId()); - ret.add(uplayer.getName()); + ret.add(mplayer.getId()); + ret.add(mplayer.getName()); } return ret; @@ -779,22 +779,22 @@ public class EngineDynmap extends EngineAbstract } // Players - List playersList = faction.getUPlayers(); + List playersList = faction.getMPlayers(); String playersCount = String.valueOf(playersList.size()); String players = getPlayerString(playersList); MPlayer playersLeaderObject = faction.getLeader(); String playersLeader = getPlayerName(playersLeaderObject); - List playersOfficersList = faction.getUPlayersWhereRole(Rel.OFFICER); + List playersOfficersList = faction.getMPlayersWhereRole(Rel.OFFICER); String playersOfficersCount = String.valueOf(playersOfficersList.size()); String playersOfficers = getPlayerString(playersOfficersList); - List playersMembersList = faction.getUPlayersWhereRole(Rel.MEMBER); + List playersMembersList = faction.getMPlayersWhereRole(Rel.MEMBER); String playersMembersCount = String.valueOf(playersMembersList.size()); String playersMembers = getPlayerString(playersMembersList); - List playersRecruitsList = faction.getUPlayersWhereRole(Rel.RECRUIT); + List playersRecruitsList = faction.getMPlayersWhereRole(Rel.RECRUIT); String playersRecruitsCount = String.valueOf(playersRecruitsList.size()); String playersRecruits = getPlayerString(playersRecruitsList); @@ -812,21 +812,21 @@ public class EngineDynmap extends EngineAbstract return ret; } - public static String getPlayerString(List uplayers) + public static String getPlayerString(List mplayers) { String ret = ""; - for (MPlayer uplayer : uplayers) + for (MPlayer mplayer : mplayers) { if (ret.length() > 0) ret += ", "; - ret += getPlayerName(uplayer); + ret += getPlayerName(mplayer); } return ret; } - public static String getPlayerName(MPlayer uplayer) + public static String getPlayerName(MPlayer mplayer) { - if (uplayer == null) return "none"; - return escapeHtml(uplayer.getName()); + if (mplayer == null) return "none"; + return escapeHtml(mplayer.getName()); } public static String boolcolor(String string, boolean bool) diff --git a/src/main/java/com/massivecraft/factions/integration/lwc/EngineLwc.java b/src/main/java/com/massivecraft/factions/integration/lwc/EngineLwc.java index b59eb2c8..33bb0325 100644 --- a/src/main/java/com/massivecraft/factions/integration/lwc/EngineLwc.java +++ b/src/main/java/com/massivecraft/factions/integration/lwc/EngineLwc.java @@ -72,7 +72,7 @@ public class EngineLwc implements Listener public static void removeAlienProtections(PS chunkPs, Faction faction) { - List nonAliens = faction.getUPlayers(); + List nonAliens = faction.getMPlayers(); for (Protection protection : getProtectionsInChunk(chunkPs)) { MPlayer owner = MPlayer.get(protection.getOwner()); diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsListenerEcon.java b/src/main/java/com/massivecraft/factions/listeners/FactionsListenerEcon.java index a74df86a..6c18e151 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsListenerEcon.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsListenerEcon.java @@ -57,12 +57,12 @@ public class FactionsListenerEcon implements Listener if (event.getReason() != MembershipChangeReason.LEAVE) return; // ... and that player was the last one in the faction ... - MPlayer uplayer = event.getUPlayer(); - Faction oldFaction = uplayer.getFaction(); - if (oldFaction.getUPlayers().size() > 1) return; + MPlayer mplayer = event.getMPlayer(); + Faction oldFaction = mplayer.getFaction(); + if (oldFaction.getMPlayers().size() > 1) return; // ... then transfer all money to the player. - Econ.transferMoney(uplayer, oldFaction, uplayer, Money.get(oldFaction)); + Econ.transferMoney(mplayer, oldFaction, mplayer, Money.get(oldFaction)); } // -------------------------------------------- // diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsListenerMain.java b/src/main/java/com/massivecraft/factions/listeners/FactionsListenerMain.java index 882ece0c..62adf642 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsListenerMain.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsListenerMain.java @@ -121,16 +121,16 @@ public class FactionsListenerMain implements Listener // CHUNK CHANGE: TERRITORY INFO // -------------------------------------------- // - public void chunkChangeTerritoryInfo(MPlayer uplayer, Player player, PS chunkFrom, PS chunkTo, Faction factionFrom, Faction factionTo) + public void chunkChangeTerritoryInfo(MPlayer mplayer, Player player, PS chunkFrom, PS chunkTo, Faction factionFrom, Faction factionTo) { // send host faction info updates - if (uplayer.isMapAutoUpdating()) + if (mplayer.isMapAutoUpdating()) { - uplayer.sendMessage(BoardColl.get().getMap(uplayer, chunkTo, player.getLocation().getYaw())); + mplayer.sendMessage(BoardColl.get().getMap(mplayer, chunkTo, player.getLocation().getYaw())); } else if (factionFrom != factionTo) { - String msg = Txt.parse("") + " ~ " + factionTo.getName(uplayer); + String msg = Txt.parse("") + " ~ " + factionTo.getName(mplayer); if (factionTo.hasDescription()) { msg += " - " + factionTo.getDescription(); @@ -140,24 +140,24 @@ public class FactionsListenerMain implements Listener // Show access level message if it changed. TerritoryAccess accessFrom = BoardColl.get().getTerritoryAccessAt(chunkFrom); - Boolean hasTerritoryAccessFrom = accessFrom.hasTerritoryAccess(uplayer); + Boolean hasTerritoryAccessFrom = accessFrom.hasTerritoryAccess(mplayer); TerritoryAccess accessTo = BoardColl.get().getTerritoryAccessAt(chunkTo); - Boolean hasTerritoryAccessTo = accessTo.hasTerritoryAccess(uplayer); + Boolean hasTerritoryAccessTo = accessTo.hasTerritoryAccess(mplayer); if (!MUtil.equals(hasTerritoryAccessFrom, hasTerritoryAccessTo)) { if (hasTerritoryAccessTo == null) { - uplayer.msg("You have standard access to this area."); + mplayer.msg("You have standard access to this area."); } else if (hasTerritoryAccessTo) { - uplayer.msg("You have elevated access to this area."); + mplayer.msg("You have elevated access to this area."); } else { - uplayer.msg("You have decreased access to this area."); + mplayer.msg("You have decreased access to this area."); } } } @@ -166,14 +166,14 @@ public class FactionsListenerMain implements Listener // CHUNK CHANGE: AUTO CLAIM // -------------------------------------------- // - public void chunkChangeAutoClaim(MPlayer uplayer, PS chunkTo) + public void chunkChangeAutoClaim(MPlayer mplayer, PS chunkTo) { // If the player is auto claiming ... - Faction autoClaimFaction = uplayer.getAutoClaimFaction(); + Faction autoClaimFaction = mplayer.getAutoClaimFaction(); if (autoClaimFaction == null) return; // ... try claim. - uplayer.tryClaim(autoClaimFaction, chunkTo, true, true); + mplayer.tryClaim(autoClaimFaction, chunkTo, true, true); } // -------------------------------------------- // @@ -462,10 +462,10 @@ public class FactionsListenerMain implements Listener // If a player is trying to run a command ... Player player = event.getPlayer(); - MPlayer uplayer = MPlayer.get(player); + MPlayer mplayer = MPlayer.get(player); // ... and the player does not have adminmode ... - if (uplayer.isUsingAdminMode()) return; + if (mplayer.isUsingAdminMode()) return; // ... clean up the command ... String command = event.getMessage(); @@ -474,9 +474,9 @@ public class FactionsListenerMain implements Listener command = command.trim(); // ... the command may be denied for members of permanent factions ... - if (uplayer.hasFaction() && uplayer.getFaction().getFlag(FFlag.PERMANENT) && containsCommand(command, MConf.get().denyCommandsPermanentFactionMember)) + if (mplayer.hasFaction() && mplayer.getFaction().getFlag(FFlag.PERMANENT) && containsCommand(command, MConf.get().denyCommandsPermanentFactionMember)) { - uplayer.msg("You can't use \"/%s\" as member of a permanent faction.", command); + mplayer.msg("You can't use \"/%s\" as member of a permanent faction.", command); event.setCancelled(true); return; } @@ -487,13 +487,13 @@ public class FactionsListenerMain implements Listener if (factionAtPs.isNone()) return; // TODO: An NPE can arise here? Why? // ... the command may be denied in the territory of this relation type ... - Rel rel = factionAtPs.getRelationTo(uplayer); + Rel rel = factionAtPs.getRelationTo(mplayer); List deniedCommands = MConf.get().denyCommandsTerritoryRelation.get(rel); if (deniedCommands == null) return; if (!containsCommand(command, deniedCommands)) return; - uplayer.msg("You can't use \"/%s\" in %s territory.", command, Txt.getNicedEnum(rel)); + mplayer.msg("You can't use \"/%s\" in %s territory.", command, Txt.getNicedEnum(rel)); event.setCancelled(true); } @@ -712,21 +712,21 @@ public class FactionsListenerMain implements Listener String name = player.getName(); if (MConf.get().playersWhoBypassAllProtection.contains(name)) return true; - MPlayer uplayer = MPlayer.get(player); - if (uplayer.isUsingAdminMode()) return true; + MPlayer mplayer = MPlayer.get(player); + if (mplayer.isUsingAdminMode()) return true; - if (!FPerm.BUILD.has(uplayer, ps, false) && FPerm.PAINBUILD.has(uplayer, ps, false)) + if (!FPerm.BUILD.has(mplayer, ps, false) && FPerm.PAINBUILD.has(mplayer, ps, false)) { if (verboose) { Faction hostFaction = BoardColl.get().getFactionAt(ps); - uplayer.msg("It is painful to build in the territory of %s.", hostFaction.describeTo(uplayer)); + mplayer.msg("It is painful to build in the territory of %s.", hostFaction.describeTo(mplayer)); player.damage(MConf.get().actionDeniedPainAmount); } return true; } - return FPerm.BUILD.has(uplayer, ps, verboose); + return FPerm.BUILD.has(mplayer, ps, verboose); } @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) @@ -891,10 +891,10 @@ public class FactionsListenerMain implements Listener String name = player.getName(); if (MConf.get().playersWhoBypassAllProtection.contains(name)) return true; - MPlayer uplayer = MPlayer.get(player); - if (uplayer.isUsingAdminMode()) return true; + MPlayer mplayer = MPlayer.get(player); + if (mplayer.isUsingAdminMode()) return true; - return FPerm.BUILD.has(uplayer, ps, !justCheck); + return FPerm.BUILD.has(mplayer, ps, !justCheck); } public static boolean canPlayerUseBlock(Player player, Block block, boolean justCheck) @@ -948,7 +948,7 @@ public class FactionsListenerMain implements Listener { // If a player is respawning ... final Player player = event.getPlayer(); - final MPlayer uplayer = MPlayer.get(player); + final MPlayer mplayer = MPlayer.get(player); // ... homes are enabled, active and at this priority ... if (!MConf.get().homesEnabled) return; @@ -956,7 +956,7 @@ public class FactionsListenerMain implements Listener if (MConf.get().homesTeleportToOnDeathPriority != priority) return; // ... and the player has a faction ... - final Faction faction = uplayer.getFaction(); + final Faction faction = mplayer.getFaction(); if (faction.isNone()) return; // ... and the faction has a home ... diff --git a/src/main/java/com/massivecraft/factions/mixin/PowerMixin.java b/src/main/java/com/massivecraft/factions/mixin/PowerMixin.java index 6e27b747..61467a78 100644 --- a/src/main/java/com/massivecraft/factions/mixin/PowerMixin.java +++ b/src/main/java/com/massivecraft/factions/mixin/PowerMixin.java @@ -4,9 +4,9 @@ import com.massivecraft.factions.entity.MPlayer; public interface PowerMixin { - public double getMaxUniversal(MPlayer uplayer); - public double getMax(MPlayer uplayer); - public double getMin(MPlayer uplayer); - public double getPerHour(MPlayer uplayer); - public double getPerDeath(MPlayer uplayer); + public double getMaxUniversal(MPlayer mplayer); + public double getMax(MPlayer mplayer); + public double getMin(MPlayer mplayer); + public double getPerHour(MPlayer mplayer); + public double getPerDeath(MPlayer mplayer); } diff --git a/src/main/java/com/massivecraft/factions/util/RelationUtil.java b/src/main/java/com/massivecraft/factions/util/RelationUtil.java index a2a46170..ad5aca1b 100644 --- a/src/main/java/com/massivecraft/factions/util/RelationUtil.java +++ b/src/main/java/com/massivecraft/factions/util/RelationUtil.java @@ -40,18 +40,18 @@ public class RelationUtil } else if (that instanceof MPlayer) { - MPlayer uplayerthat = (MPlayer) that; + MPlayer mplayerthat = (MPlayer) that; if (that == me) { ret = "you"; } else if (thatFaction == myFaction) { - ret = uplayerthat.getNameAndTitle(myFaction); + ret = mplayerthat.getNameAndTitle(myFaction); } else { - ret = uplayerthat.getNameAndFactionName(); + ret = mplayerthat.getNameAndFactionName(); } }