diff --git a/src/com/massivecraft/factions/Const.java b/src/com/massivecraft/factions/Const.java index b9be839d..8bdcf842 100644 --- a/src/com/massivecraft/factions/Const.java +++ b/src/com/massivecraft/factions/Const.java @@ -12,14 +12,14 @@ public class Const // MStore Collection Names public static final String COLLECTION_BASENAME = "factions"; public static final String COLLECTION_BASENAME_ = COLLECTION_BASENAME+"_"; - public static final String COLLECTION_BASENAME_MCONF = COLLECTION_BASENAME_+"mconf"; - public static final String COLLECTION_BASENAME_UCONF = COLLECTION_BASENAME_+"uconf"; public static final String COLLECTION_BASENAME_BOARD = COLLECTION_BASENAME_+"board"; - public static final String COLLECTION_BASENAME_PLAYER = COLLECTION_BASENAME_+"player"; public static final String COLLECTION_BASENAME_FACTION = COLLECTION_BASENAME_+"faction"; + public static final String COLLECTION_BASENAME_UPLAYER = COLLECTION_BASENAME_+"uplayer"; + public static final String COLLECTION_BASENAME_MPLAYER = COLLECTION_BASENAME_+"mplayer"; + public static final String COLLECTION_BASENAME_UCONF = COLLECTION_BASENAME_+"uconf"; + public static final String COLLECTION_BASENAME_MCONF = COLLECTION_BASENAME_+"mconf"; // Aspect Ids - public static final String ASPECT_ID = "factions"; // Defautlt faction ids diff --git a/src/com/massivecraft/factions/FPerm.java b/src/com/massivecraft/factions/FPerm.java index 54d5f954..7b2fa128 100644 --- a/src/com/massivecraft/factions/FPerm.java +++ b/src/com/massivecraft/factions/FPerm.java @@ -11,7 +11,7 @@ import java.util.Set; import org.bukkit.command.CommandSender; import com.massivecraft.factions.entity.BoardColls; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.UConf; import com.massivecraft.mcore.ps.PS; @@ -174,7 +174,7 @@ public enum FPerm if (testSubject instanceof CommandSender) { - rpSubject = FPlayer.get(testSubject); + rpSubject = UPlayer.get(testSubject); } else if (testSubject instanceof RelationParticipator) { @@ -190,11 +190,11 @@ public enum FPerm // TODO: Create better description messages like: "You must at least be officer". boolean ret = hostFaction.getPermittedRelations(this).contains(rel); - if (rpSubject instanceof FPlayer && ret == false && ((FPlayer)rpSubject).isUsingAdminMode()) ret = true; + if (rpSubject instanceof UPlayer && ret == false && ((UPlayer)rpSubject).isUsingAdminMode()) ret = true; - if (!ret && informIfNot && rpSubject instanceof FPlayer) + if (!ret && informIfNot && rpSubject instanceof UPlayer) { - FPlayer fplayer = (FPlayer)rpSubject; + UPlayer fplayer = (UPlayer)rpSubject; fplayer.msg(errorpattern, hostFaction.describeTo(fplayer, true), this.getDescription()); if (Perm.ADMIN.has(fplayer.getPlayer())) { @@ -218,11 +218,11 @@ public enum FPerm { if (informIfNot) { - FPlayer notify = null; + UPlayer notify = null; if (testSubject instanceof CommandSender) - notify = FPlayer.get(testSubject); - else if (testSubject instanceof FPlayer) - notify = (FPlayer)testSubject; + notify = UPlayer.get(testSubject); + else if (testSubject instanceof UPlayer) + notify = (UPlayer)testSubject; if (notify != null) notify.msg("This territory owned by your faction has restricted access."); } diff --git a/src/com/massivecraft/factions/FactionEqualsPredictate.java b/src/com/massivecraft/factions/FactionEqualsPredictate.java index 06741ef9..6c847ff1 100644 --- a/src/com/massivecraft/factions/FactionEqualsPredictate.java +++ b/src/com/massivecraft/factions/FactionEqualsPredictate.java @@ -4,7 +4,7 @@ import java.io.Serializable; import org.bukkit.command.CommandSender; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.mcore.Predictate; @@ -35,7 +35,7 @@ public class FactionEqualsPredictate implements Predictate, Seria @Override public boolean apply(CommandSender sender) { - FPlayer fplayer = FPlayer.get(sender); + UPlayer fplayer = UPlayer.get(sender); return this.factionId.equals(fplayer.getFactionId()); } diff --git a/src/com/massivecraft/factions/FactionListComparator.java b/src/com/massivecraft/factions/FactionListComparator.java index 4f36cae4..861a7fdb 100644 --- a/src/com/massivecraft/factions/FactionListComparator.java +++ b/src/com/massivecraft/factions/FactionListComparator.java @@ -36,11 +36,11 @@ public class FactionListComparator implements Comparator if (ret != 0) return ret; // Players Online - ret = f2.getFPlayersWhereOnline(true).size() - f1.getFPlayersWhereOnline(true).size(); + ret = f2.getUPlayersWhereOnline(true).size() - f1.getUPlayersWhereOnline(true).size(); if (ret != 0) return ret; // Players Total - ret = f2.getFPlayers().size() - f1.getFPlayers().size(); + ret = f2.getUPlayers().size() - f1.getUPlayers().size(); if (ret != 0) return ret; // Tie by Id diff --git a/src/com/massivecraft/factions/Factions.java b/src/com/massivecraft/factions/Factions.java index 17aea3e7..997568a1 100644 --- a/src/com/massivecraft/factions/Factions.java +++ b/src/com/massivecraft/factions/Factions.java @@ -21,7 +21,7 @@ import com.massivecraft.factions.chat.tag.ChatTagTitle; import com.massivecraft.factions.cmd.*; import com.massivecraft.factions.entity.Board; import com.massivecraft.factions.entity.BoardColls; -import com.massivecraft.factions.entity.FPlayerColls; +import com.massivecraft.factions.entity.UPlayerColls; import com.massivecraft.factions.entity.FactionColls; import com.massivecraft.factions.entity.MConfColl; import com.massivecraft.factions.integration.LWCFeatures; @@ -103,11 +103,11 @@ public class Factions extends MPlugin this.databaseInitialized = false; MConfColl.get().init(); - FPlayerColls.get().init(); + UPlayerColls.get().init(); FactionColls.get().init(); BoardColls.get().init(); - FactionColls.get().reindexFPlayers(); + FactionColls.get().reindexUPlayers(); this.databaseInitialized = true; diff --git a/src/com/massivecraft/factions/TerritoryAccess.java b/src/com/massivecraft/factions/TerritoryAccess.java index ed7e75c7..8aa3a2d8 100644 --- a/src/com/massivecraft/factions/TerritoryAccess.java +++ b/src/com/massivecraft/factions/TerritoryAccess.java @@ -6,7 +6,7 @@ import java.util.Set; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.FactionColls; @@ -78,9 +78,9 @@ public class TerritoryAccess public void addFPlayer(String fplayerID) { this.getFPlayerIds().add(fplayerID); } - public void addFPlayer(FPlayer fplayer) { this.addFPlayer(fplayer.getId()); } + public void addFPlayer(UPlayer fplayer) { this.addFPlayer(fplayer.getId()); } public void removeFPlayer(String fplayerID) { this.getFPlayerIds().remove(fplayerID); } - public void removeFPlayer(FPlayer fplayer) { this.removeFPlayer(fplayer.getId()); } + public void removeFPlayer(UPlayer fplayer) { this.removeFPlayer(fplayer.getId()); } public boolean toggleFPlayer(String fplayerID) { @@ -92,7 +92,7 @@ public class TerritoryAccess this.addFPlayer(fplayerID); return true; } - public boolean toggleFPlayer(FPlayer fplayer) + public boolean toggleFPlayer(UPlayer fplayer) { return this.toggleFPlayer(fplayer.getId()); } @@ -103,9 +103,9 @@ public class TerritoryAccess if (testSubject instanceof String) return hostFactionId.equals((String)testSubject); else if (testSubject instanceof CommandSender) - return hostFactionId.equals(FPlayer.get(testSubject).getFactionId()); - else if (testSubject instanceof FPlayer) - return hostFactionId.equals(((FPlayer)testSubject).getFactionId()); + return hostFactionId.equals(UPlayer.get(testSubject).getFactionId()); + else if (testSubject instanceof UPlayer) + return hostFactionId.equals(((UPlayer)testSubject).getFactionId()); else if (testSubject instanceof Faction) return hostFactionId.equals(((Faction)testSubject).getId()); return false; @@ -158,14 +158,14 @@ public class TerritoryAccess public boolean subjectHasAccess(Object testSubject) { if (testSubject instanceof Player) - return fPlayerHasAccess(FPlayer.get(testSubject)); - else if (testSubject instanceof FPlayer) - return fPlayerHasAccess((FPlayer)testSubject); + return fPlayerHasAccess(UPlayer.get(testSubject)); + else if (testSubject instanceof UPlayer) + return fPlayerHasAccess((UPlayer)testSubject); else if (testSubject instanceof Faction) return factionHasAccess((Faction)testSubject); return false; } - public boolean fPlayerHasAccess(FPlayer fplayer) + public boolean fPlayerHasAccess(UPlayer fplayer) { if (factionHasAccess(fplayer.getFactionId())) return true; return fplayerIds.contains(fplayer.getId()); diff --git a/src/com/massivecraft/factions/chat/ChatFormatter.java b/src/com/massivecraft/factions/chat/ChatFormatter.java index 372872fd..2fd77baa 100644 --- a/src/com/massivecraft/factions/chat/ChatFormatter.java +++ b/src/com/massivecraft/factions/chat/ChatFormatter.java @@ -8,7 +8,7 @@ import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; /** * The ChatFormater is a system offered by factions for tag parsing. @@ -102,7 +102,7 @@ public class ChatFormatter // FORMAT // -------------------------------------------- // - public static String format(String msg, FPlayer fsender, FPlayer frecipient) + public static String format(String msg, UPlayer fsender, UPlayer frecipient) { // We build the return value in this string buffer StringBuffer ret = new StringBuffer(); @@ -159,7 +159,7 @@ public class ChatFormatter // TAG COMPUTE // -------------------------------------------- // - public static String compute(ChatTag tag, List modifierIds, FPlayer fsender, FPlayer frecipient) + public static String compute(ChatTag tag, List modifierIds, UPlayer fsender, UPlayer frecipient) { String ret = tag.getReplacement(fsender, frecipient); if (ret == null) return null; diff --git a/src/com/massivecraft/factions/chat/ChatModifier.java b/src/com/massivecraft/factions/chat/ChatModifier.java index 2170ad2c..73ed76e2 100644 --- a/src/com/massivecraft/factions/chat/ChatModifier.java +++ b/src/com/massivecraft/factions/chat/ChatModifier.java @@ -1,12 +1,12 @@ package com.massivecraft.factions.chat; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; public interface ChatModifier { public String getId(); - public String getModified(String subject, FPlayer fsender, FPlayer frecipient); + public String getModified(String subject, UPlayer fsender, UPlayer frecipient); public boolean register(); public boolean unregister(); } diff --git a/src/com/massivecraft/factions/chat/ChatTag.java b/src/com/massivecraft/factions/chat/ChatTag.java index 1f4dfa2a..233a5179 100644 --- a/src/com/massivecraft/factions/chat/ChatTag.java +++ b/src/com/massivecraft/factions/chat/ChatTag.java @@ -1,11 +1,11 @@ package com.massivecraft.factions.chat; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; public interface ChatTag { public String getId(); - public String getReplacement(FPlayer fsender, FPlayer frecipient); + public String getReplacement(UPlayer fsender, UPlayer frecipient); public boolean register(); public boolean unregister(); } diff --git a/src/com/massivecraft/factions/chat/modifier/ChatModifierLc.java b/src/com/massivecraft/factions/chat/modifier/ChatModifierLc.java index 3e3bad56..5c6a9377 100644 --- a/src/com/massivecraft/factions/chat/modifier/ChatModifierLc.java +++ b/src/com/massivecraft/factions/chat/modifier/ChatModifierLc.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.chat.modifier; import com.massivecraft.factions.chat.ChatModifierAbstract; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; public class ChatModifierLc extends ChatModifierAbstract { @@ -18,7 +18,7 @@ public class ChatModifierLc extends ChatModifierAbstract // -------------------------------------------- // @Override - public String getModified(String subject, FPlayer fsender, FPlayer frecipient) + public String getModified(String subject, UPlayer fsender, UPlayer frecipient) { return subject.toLowerCase(); } diff --git a/src/com/massivecraft/factions/chat/modifier/ChatModifierLp.java b/src/com/massivecraft/factions/chat/modifier/ChatModifierLp.java index 6ebb63fa..06418c2f 100644 --- a/src/com/massivecraft/factions/chat/modifier/ChatModifierLp.java +++ b/src/com/massivecraft/factions/chat/modifier/ChatModifierLp.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.chat.modifier; import com.massivecraft.factions.chat.ChatModifierAbstract; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; public class ChatModifierLp extends ChatModifierAbstract @@ -19,7 +19,7 @@ public class ChatModifierLp extends ChatModifierAbstract // -------------------------------------------- // @Override - public String getModified(String subject, FPlayer fsender, FPlayer frecipient) + public String getModified(String subject, UPlayer fsender, UPlayer frecipient) { if (subject.equals("")) return subject; return " "+subject; diff --git a/src/com/massivecraft/factions/chat/modifier/ChatModifierParse.java b/src/com/massivecraft/factions/chat/modifier/ChatModifierParse.java index 875d4b62..e74d08d5 100644 --- a/src/com/massivecraft/factions/chat/modifier/ChatModifierParse.java +++ b/src/com/massivecraft/factions/chat/modifier/ChatModifierParse.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.chat.modifier; import com.massivecraft.factions.chat.ChatModifierAbstract; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.mcore.util.Txt; public class ChatModifierParse extends ChatModifierAbstract @@ -19,7 +19,7 @@ public class ChatModifierParse extends ChatModifierAbstract // -------------------------------------------- // @Override - public String getModified(String subject, FPlayer fsender, FPlayer frecipient) + public String getModified(String subject, UPlayer fsender, UPlayer frecipient) { return Txt.parse(subject); } diff --git a/src/com/massivecraft/factions/chat/modifier/ChatModifierRp.java b/src/com/massivecraft/factions/chat/modifier/ChatModifierRp.java index 718dd140..a53e1cc7 100644 --- a/src/com/massivecraft/factions/chat/modifier/ChatModifierRp.java +++ b/src/com/massivecraft/factions/chat/modifier/ChatModifierRp.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.chat.modifier; import com.massivecraft.factions.chat.ChatModifierAbstract; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; public class ChatModifierRp extends ChatModifierAbstract { @@ -18,7 +18,7 @@ public class ChatModifierRp extends ChatModifierAbstract // -------------------------------------------- // @Override - public String getModified(String subject, FPlayer fsender, FPlayer frecipient) + public String getModified(String subject, UPlayer fsender, UPlayer frecipient) { if (subject.equals("")) return subject; return subject+" "; diff --git a/src/com/massivecraft/factions/chat/modifier/ChatModifierUc.java b/src/com/massivecraft/factions/chat/modifier/ChatModifierUc.java index 1bc9e05a..8b03fae1 100644 --- a/src/com/massivecraft/factions/chat/modifier/ChatModifierUc.java +++ b/src/com/massivecraft/factions/chat/modifier/ChatModifierUc.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.chat.modifier; import com.massivecraft.factions.chat.ChatModifierAbstract; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; public class ChatModifierUc extends ChatModifierAbstract { @@ -18,7 +18,7 @@ public class ChatModifierUc extends ChatModifierAbstract // -------------------------------------------- // @Override - public String getModified(String subject, FPlayer fsender, FPlayer frecipient) + public String getModified(String subject, UPlayer fsender, UPlayer frecipient) { return subject.toUpperCase(); } diff --git a/src/com/massivecraft/factions/chat/modifier/ChatModifierUcf.java b/src/com/massivecraft/factions/chat/modifier/ChatModifierUcf.java index e69610a7..702001a5 100644 --- a/src/com/massivecraft/factions/chat/modifier/ChatModifierUcf.java +++ b/src/com/massivecraft/factions/chat/modifier/ChatModifierUcf.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.chat.modifier; import com.massivecraft.factions.chat.ChatModifierAbstract; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.mcore.util.Txt; public class ChatModifierUcf extends ChatModifierAbstract @@ -19,7 +19,7 @@ public class ChatModifierUcf extends ChatModifierAbstract // -------------------------------------------- // @Override - public String getModified(String subject, FPlayer fsender, FPlayer frecipient) + public String getModified(String subject, UPlayer fsender, UPlayer frecipient) { return Txt.upperCaseFirst(subject); } diff --git a/src/com/massivecraft/factions/chat/tag/ChatTagRelcolor.java b/src/com/massivecraft/factions/chat/tag/ChatTagRelcolor.java index b5eabfd1..16daab85 100644 --- a/src/com/massivecraft/factions/chat/tag/ChatTagRelcolor.java +++ b/src/com/massivecraft/factions/chat/tag/ChatTagRelcolor.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.chat.tag; import com.massivecraft.factions.chat.ChatTagAbstract; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; public class ChatTagRelcolor extends ChatTagAbstract { @@ -18,7 +18,7 @@ public class ChatTagRelcolor extends ChatTagAbstract // -------------------------------------------- // @Override - public String getReplacement(FPlayer fsender, FPlayer frecipient) + public String getReplacement(UPlayer fsender, UPlayer frecipient) { if (fsender == null) return ""; if (frecipient == null) return ""; diff --git a/src/com/massivecraft/factions/chat/tag/ChatTagRole.java b/src/com/massivecraft/factions/chat/tag/ChatTagRole.java index c5d1ca41..6d5f4e39 100644 --- a/src/com/massivecraft/factions/chat/tag/ChatTagRole.java +++ b/src/com/massivecraft/factions/chat/tag/ChatTagRole.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.chat.tag; import com.massivecraft.factions.chat.ChatTagAbstract; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.mcore.util.Txt; public class ChatTagRole extends ChatTagAbstract @@ -19,7 +19,7 @@ public class ChatTagRole extends ChatTagAbstract // -------------------------------------------- // @Override - public String getReplacement(FPlayer fsender, FPlayer frecipient) + public String getReplacement(UPlayer fsender, UPlayer frecipient) { return Txt.upperCaseFirst(fsender.getRole().toString().toLowerCase()); } diff --git a/src/com/massivecraft/factions/chat/tag/ChatTagRoleprefix.java b/src/com/massivecraft/factions/chat/tag/ChatTagRoleprefix.java index 33523a6f..6299683b 100644 --- a/src/com/massivecraft/factions/chat/tag/ChatTagRoleprefix.java +++ b/src/com/massivecraft/factions/chat/tag/ChatTagRoleprefix.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.chat.tag; import com.massivecraft.factions.chat.ChatTagAbstract; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; public class ChatTagRoleprefix extends ChatTagAbstract { @@ -18,7 +18,7 @@ public class ChatTagRoleprefix extends ChatTagAbstract // -------------------------------------------- // @Override - public String getReplacement(FPlayer fsender, FPlayer frecipient) + public String getReplacement(UPlayer fsender, UPlayer frecipient) { return fsender.getRole().getPrefix(); } diff --git a/src/com/massivecraft/factions/chat/tag/ChatTagTag.java b/src/com/massivecraft/factions/chat/tag/ChatTagTag.java index 15210f9c..233acc54 100644 --- a/src/com/massivecraft/factions/chat/tag/ChatTagTag.java +++ b/src/com/massivecraft/factions/chat/tag/ChatTagTag.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.chat.tag; import com.massivecraft.factions.chat.ChatTagAbstract; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; public class ChatTagTag extends ChatTagAbstract { @@ -18,7 +18,7 @@ public class ChatTagTag extends ChatTagAbstract // -------------------------------------------- // @Override - public String getReplacement(FPlayer fsender, FPlayer frecipient) + public String getReplacement(UPlayer fsender, UPlayer frecipient) { if (!fsender.hasFaction()) return ""; return fsender.getFaction().getTag(); diff --git a/src/com/massivecraft/factions/chat/tag/ChatTagTagforce.java b/src/com/massivecraft/factions/chat/tag/ChatTagTagforce.java index e072482c..2384ee14 100644 --- a/src/com/massivecraft/factions/chat/tag/ChatTagTagforce.java +++ b/src/com/massivecraft/factions/chat/tag/ChatTagTagforce.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.chat.tag; import com.massivecraft.factions.chat.ChatTagAbstract; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; public class ChatTagTagforce extends ChatTagAbstract { @@ -18,7 +18,7 @@ public class ChatTagTagforce extends ChatTagAbstract // -------------------------------------------- // @Override - public String getReplacement(FPlayer fsender, FPlayer frecipient) + public String getReplacement(UPlayer fsender, UPlayer frecipient) { return fsender.getFaction().getTag(); } diff --git a/src/com/massivecraft/factions/chat/tag/ChatTagTitle.java b/src/com/massivecraft/factions/chat/tag/ChatTagTitle.java index dca73f6c..a2bde9b9 100644 --- a/src/com/massivecraft/factions/chat/tag/ChatTagTitle.java +++ b/src/com/massivecraft/factions/chat/tag/ChatTagTitle.java @@ -1,7 +1,7 @@ package com.massivecraft.factions.chat.tag; import com.massivecraft.factions.chat.ChatTagAbstract; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; public class ChatTagTitle extends ChatTagAbstract { @@ -18,7 +18,7 @@ public class ChatTagTitle extends ChatTagAbstract // -------------------------------------------- // @Override - public String getReplacement(FPlayer fsender, FPlayer frecipient) + public String getReplacement(UPlayer fsender, UPlayer frecipient) { return fsender.getTitle(); } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsAccess.java b/src/com/massivecraft/factions/cmd/CmdFactionsAccess.java index 4624e2d4..31cfbcc2 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsAccess.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsAccess.java @@ -3,10 +3,10 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.FPerm; import com.massivecraft.factions.Perm; import com.massivecraft.factions.TerritoryAccess; -import com.massivecraft.factions.cmd.arg.ARFPlayer; +import com.massivecraft.factions.cmd.arg.ARUPlayer; import com.massivecraft.factions.cmd.arg.ARFaction; import com.massivecraft.factions.entity.BoardColls; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.integration.SpoutFeatures; import com.massivecraft.mcore.cmd.req.ReqIsPlayer; @@ -73,7 +73,7 @@ public class CmdFactionsAccess extends FCommand if (doPlayer) { - FPlayer targetPlayer = this.arg(1, ARFPlayer.getStartAny(fme), fme); + UPlayer targetPlayer = this.arg(1, ARUPlayer.getStartAny(fme), fme); if (targetPlayer == null) return; added = territory.toggleFPlayer(targetPlayer); target = "Player \""+targetPlayer.getName()+"\""; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java b/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java index 2fdb2f28..bc5b09ad 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java @@ -5,8 +5,8 @@ import java.util.ArrayList; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; import com.massivecraft.factions.Rel; -import com.massivecraft.factions.entity.FPlayer; -import com.massivecraft.factions.entity.FPlayerColls; +import com.massivecraft.factions.entity.UPlayer; +import com.massivecraft.factions.entity.UPlayerColls; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.FactionColl; import com.massivecraft.factions.entity.FactionColls; @@ -75,7 +75,7 @@ public class CmdFactionsCreate extends FCommand // NOTE: join event cannot be cancelled or you'll have an empty faction // Inform - for (FPlayer follower : FPlayerColls.get().get(fme).getAllOnline()) + for (UPlayer follower : UPlayerColls.get().get(fme).getAllOnline()) { follower.msg("%s created a new faction %s", fme.describeTo(follower, true), faction.getTag(follower)); } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsDemote.java b/src/com/massivecraft/factions/cmd/CmdFactionsDemote.java index ad56ad9e..18877d03 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsDemote.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsDemote.java @@ -2,8 +2,8 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; import com.massivecraft.factions.Rel; -import com.massivecraft.factions.cmd.arg.ARFPlayer; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.cmd.arg.ARUPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.mcore.cmd.req.ReqHasPerm; public class CmdFactionsDemote extends FCommand @@ -25,7 +25,7 @@ public class CmdFactionsDemote extends FCommand @Override public void perform() { - FPlayer you = this.arg(0, ARFPlayer.getStartAny(fme)); + UPlayer you = this.arg(0, ARUPlayer.getStartAny(fme)); if (you == null) return; if (you.getFaction() != myFaction) diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java b/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java index 607d43d1..c49005cc 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java @@ -1,8 +1,8 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.cmd.arg.ARFaction; -import com.massivecraft.factions.entity.FPlayer; -import com.massivecraft.factions.entity.FPlayerColls; +import com.massivecraft.factions.entity.UPlayer; +import com.massivecraft.factions.entity.UPlayerColls; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.FactionColls; import com.massivecraft.factions.entity.MConf; @@ -53,24 +53,24 @@ public class CmdFactionsDisband extends FCommand // Merged Apply and Inform - // Send FPlayerLeaveEvent for each player in the faction - for (FPlayer fplayer : faction.getFPlayers()) + // Run event for each player in the faction + for (UPlayer uplayer : faction.getUPlayers()) { - FactionsEventMembershipChange membershipChangeEvent = new FactionsEventMembershipChange(sender, fplayer, FactionColls.get().get(faction).getNone(), MembershipChangeReason.DISBAND); + FactionsEventMembershipChange membershipChangeEvent = new FactionsEventMembershipChange(sender, uplayer, FactionColls.get().get(faction).getNone(), MembershipChangeReason.DISBAND); membershipChangeEvent.run(); } // Inform all players - for (FPlayer fplayer : FPlayerColls.get().get(fme).getAllOnline()) + for (UPlayer uplayer : UPlayerColls.get().get(fme).getAllOnline()) { - String who = fme.describeTo(fplayer); - if (fplayer.getFaction() == faction) + String who = fme.describeTo(uplayer); + if (uplayer.getFaction() == faction) { - fplayer.msg("%s disbanded your faction.", who); + uplayer.msg("%s disbanded your faction.", who); } else { - fplayer.msg("%s disbanded the faction %s.", who, faction.getTag(fplayer)); + uplayer.msg("%s disbanded the faction %s.", who, faction.getTag(uplayer)); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsHome.java b/src/com/massivecraft/factions/cmd/CmdFactionsHome.java index 099fef3d..fbd3db62 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsHome.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsHome.java @@ -11,7 +11,7 @@ import com.massivecraft.factions.Perm; import com.massivecraft.factions.Rel; import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast; import com.massivecraft.factions.entity.BoardColls; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.event.FactionsEventHomeTeleport; import com.massivecraft.mcore.cmd.req.ReqHasPerm; @@ -99,7 +99,7 @@ public class CmdFactionsHome extends FCommand if (p == null || !p.isOnline() || p.isDead() || p == me || p.getWorld() != w) continue; - FPlayer fp = FPlayer.get(p); + UPlayer fp = UPlayer.get(p); if (fme.getRelationTo(fp) != Rel.ENEMY) continue; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsInvite.java b/src/com/massivecraft/factions/cmd/CmdFactionsInvite.java index 17d55fbf..bfaa74d0 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsInvite.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsInvite.java @@ -3,8 +3,8 @@ 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.ARFPlayer; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.cmd.arg.ARUPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.event.FactionsEventInvitedChange; import com.massivecraft.mcore.cmd.arg.ARBoolean; import com.massivecraft.mcore.cmd.req.ReqHasPerm; @@ -27,16 +27,16 @@ public class CmdFactionsInvite extends FCommand public void perform() { // Args - FPlayer fplayer = this.arg(0, ARFPlayer.getStartAny(sender)); - if (fplayer == null) return; + UPlayer uplayer = this.arg(0, ARUPlayer.getStartAny(sender)); + if (uplayer == null) return; - Boolean newInvited = this.arg(1, ARBoolean.get(), !myFaction.isInvited(fplayer)); + Boolean newInvited = this.arg(1, ARBoolean.get(), !myFaction.isInvited(uplayer)); if (newInvited == null) return; // Allready member? - if (fplayer.getFaction() == myFaction) + if (uplayer.getFaction() == myFaction) { - msg("%s is already a member of %s", fplayer.getName(), myFaction.getTag()); + msg("%s is already a member of %s", uplayer.getName(), myFaction.getTag()); msg("You might want to: " + Factions.get().getOuterCmdFactions().cmdFactionsKick.getUseageTemplate(false)); return; } @@ -45,24 +45,24 @@ public class CmdFactionsInvite extends FCommand if ( ! FPerm.INVITE.has(sender, myFaction, true)) return; // Event - FactionsEventInvitedChange event = new FactionsEventInvitedChange(sender, fplayer, myFaction, newInvited); + FactionsEventInvitedChange event = new FactionsEventInvitedChange(sender, uplayer, myFaction, newInvited); event.run(); if (event.isCancelled()) return; newInvited = event.isNewInvited(); // Apply - myFaction.setInvited(fplayer, newInvited); + myFaction.setInvited(uplayer, newInvited); // Inform if (newInvited) { - fplayer.msg("%s invited you to %s", fme.describeTo(fplayer, true), myFaction.describeTo(fplayer)); - myFaction.msg("%s invited %s to your faction.", fme.describeTo(myFaction, true), fplayer.describeTo(myFaction)); + uplayer.msg("%s invited you to %s", fme.describeTo(uplayer, true), myFaction.describeTo(uplayer)); + myFaction.msg("%s invited %s to your faction.", fme.describeTo(myFaction, true), uplayer.describeTo(myFaction)); } else { - fplayer.msg("%s revoked your invitation to %s.", fme.describeTo(fplayer), myFaction.describeTo(fplayer)); - myFaction.msg("%s revoked %s's invitation.", fme.describeTo(myFaction), fplayer.describeTo(myFaction)); + uplayer.msg("%s revoked your invitation to %s.", fme.describeTo(uplayer), myFaction.describeTo(uplayer)); + myFaction.msg("%s revoked %s's invitation.", fme.describeTo(myFaction), uplayer.describeTo(myFaction)); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsJoin.java b/src/com/massivecraft/factions/cmd/CmdFactionsJoin.java index e01f0908..fa1513ab 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsJoin.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsJoin.java @@ -2,9 +2,9 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARFPlayer; +import com.massivecraft.factions.cmd.arg.ARUPlayer; import com.massivecraft.factions.cmd.arg.ARFaction; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.UConf; @@ -31,10 +31,10 @@ public class CmdFactionsJoin extends FCommand Faction faction = this.arg(0, ARFaction.get(sender)); if (faction == null) return; - FPlayer fplayer = this.arg(1, ARFPlayer.getStartAny(sender), fme); - if (fplayer == null) return; + UPlayer uplayer = this.arg(1, ARUPlayer.getStartAny(sender), fme); + if (uplayer == null) return; - boolean samePlayer = fplayer == fme; + boolean samePlayer = uplayer == fme; // Validate if (!samePlayer && ! Perm.JOIN_OTHERS.has(sender, false)) @@ -43,36 +43,36 @@ public class CmdFactionsJoin extends FCommand return; } - if (faction == fplayer.getFaction()) + if (faction == uplayer.getFaction()) { - msg("%s %s already a member of %s", fplayer.describeTo(fme, true), (samePlayer ? "are" : "is"), faction.getTag(fme)); + msg("%s %s already a member of %s", uplayer.describeTo(fme, true), (samePlayer ? "are" : "is"), faction.getTag(fme)); return; } - if (UConf.get(faction).factionMemberLimit > 0 && faction.getFPlayers().size() >= UConf.get(faction).factionMemberLimit) + if (UConf.get(faction).factionMemberLimit > 0 && faction.getUPlayers().size() >= UConf.get(faction).factionMemberLimit) { - msg(" ! The faction %s is at the limit of %d members, so %s cannot currently join.", faction.getTag(fme), UConf.get(faction).factionMemberLimit, fplayer.describeTo(fme, false)); + msg(" ! The faction %s is at the limit of %d members, so %s cannot currently join.", faction.getTag(fme), UConf.get(faction).factionMemberLimit, uplayer.describeTo(fme, false)); return; } - if (fplayer.hasFaction()) + if (uplayer.hasFaction()) { - msg("%s must leave %s current faction first.", fplayer.describeTo(fme, true), (samePlayer ? "your" : "their")); + msg("%s must leave %s current faction first.", uplayer.describeTo(fme, true), (samePlayer ? "your" : "their")); return; } - if (!UConf.get(faction).canLeaveWithNegativePower && fplayer.getPower() < 0) + if (!UConf.get(faction).canLeaveWithNegativePower && uplayer.getPower() < 0) { - msg("%s cannot join a faction with a negative power level.", fplayer.describeTo(fme, true)); + msg("%s cannot join a faction with a negative power level.", uplayer.describeTo(fme, true)); return; } - if( ! (faction.isOpen() || faction.isInvited(fplayer) || fme.isUsingAdminMode() || Perm.JOIN_ANY.has(sender, false))) + if( ! (faction.isOpen() || faction.isInvited(uplayer) || fme.isUsingAdminMode() || Perm.JOIN_ANY.has(sender, false))) { msg("This faction requires invitation."); if (samePlayer) { - faction.msg("%s tried to join your faction.", fplayer.describeTo(faction, true)); + faction.msg("%s tried to join your faction.", uplayer.describeTo(faction, true)); } return; } @@ -85,24 +85,24 @@ public class CmdFactionsJoin extends FCommand // Inform if (!samePlayer) { - fplayer.msg("%s moved you into the faction %s.", fme.describeTo(fplayer, true), faction.getTag(fplayer)); + uplayer.msg("%s moved you into the faction %s.", fme.describeTo(uplayer, true), faction.getTag(uplayer)); } - faction.msg("%s joined your faction.", fplayer.describeTo(faction, true)); - fme.msg("%s successfully joined %s.", fplayer.describeTo(fme, true), faction.getTag(fme)); + faction.msg("%s joined your faction.", uplayer.describeTo(faction, true)); + fme.msg("%s successfully joined %s.", uplayer.describeTo(fme, true), faction.getTag(fme)); // Apply - fplayer.resetFactionData(); - fplayer.setFaction(faction); + uplayer.resetFactionData(); + uplayer.setFaction(faction); - faction.setInvited(fplayer, false); + faction.setInvited(uplayer, false); // Derplog if (MConf.get().logFactionJoin) { if (samePlayer) - Factions.get().log("%s joined the faction %s.", fplayer.getName(), faction.getTag()); + Factions.get().log("%s joined the faction %s.", uplayer.getName(), faction.getTag()); else - Factions.get().log("%s moved the player %s into the faction %s.", fme.getName(), fplayer.getName(), faction.getTag()); + Factions.get().log("%s moved the player %s into the faction %s.", fme.getName(), uplayer.getName(), faction.getTag()); } } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsKick.java b/src/com/massivecraft/factions/cmd/CmdFactionsKick.java index 77a96130..9fced444 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsKick.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsKick.java @@ -4,8 +4,8 @@ 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.ARFPlayer; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.cmd.arg.ARUPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.FactionColls; import com.massivecraft.factions.entity.MConf; @@ -30,58 +30,58 @@ public class CmdFactionsKick extends FCommand public void perform() { // Arg - FPlayer fplayer = this.arg(1, ARFPlayer.getStartAny(sender)); - if (fplayer == null) return; + UPlayer uplayer = this.arg(1, ARUPlayer.getStartAny(sender)); + if (uplayer == null) return; // Validate - if (fme == fplayer) + if (fme == uplayer) { msg("You cannot kick yourself."); msg("You might want to: %s", Factions.get().getOuterCmdFactions().cmdFactionsLeave.getUseageTemplate(false)); return; } - if (fplayer.getRole() == Rel.LEADER && !(this.senderIsConsole || fme.isUsingAdminMode())) + if (uplayer.getRole() == Rel.LEADER && !(this.senderIsConsole || fme.isUsingAdminMode())) { msg("The leader can not be kicked."); return; } - if ( ! UConf.get(fplayer).canLeaveWithNegativePower && fplayer.getPower() < 0) + if ( ! UConf.get(uplayer).canLeaveWithNegativePower && uplayer.getPower() < 0) { msg("You cannot kick that member until their power is positive."); return; } // FPerm - Faction fplayerFaction = fplayer.getFaction(); - if (!FPerm.KICK.has(sender, fplayerFaction)) return; + Faction uplayerFaction = uplayer.getFaction(); + if (!FPerm.KICK.has(sender, uplayerFaction)) return; // Event - FactionsEventMembershipChange event = new FactionsEventMembershipChange(sender, fplayer, FactionColls.get().get(fplayer).getNone(), MembershipChangeReason.KICK); + FactionsEventMembershipChange event = new FactionsEventMembershipChange(sender, uplayer, FactionColls.get().get(uplayer).getNone(), MembershipChangeReason.KICK); event.run(); if (event.isCancelled()) return; // Inform - fplayerFaction.msg("%s kicked %s from the faction! :O", fme.describeTo(fplayerFaction, true), fplayer.describeTo(fplayerFaction, true)); - fplayer.msg("%s kicked you from %s! :O", fme.describeTo(fplayer, true), fplayerFaction.describeTo(fplayer)); - if (fplayerFaction != myFaction) + uplayerFaction.msg("%s kicked %s from the faction! :O", fme.describeTo(uplayerFaction, true), uplayer.describeTo(uplayerFaction, true)); + uplayer.msg("%s kicked you from %s! :O", fme.describeTo(uplayer, true), uplayerFaction.describeTo(uplayer)); + if (uplayerFaction != myFaction) { - fme.msg("You kicked %s from the faction %s!", fplayer.describeTo(fme), fplayerFaction.describeTo(fme)); + fme.msg("You kicked %s from the faction %s!", uplayer.describeTo(fme), uplayerFaction.describeTo(fme)); } if (MConf.get().logFactionKick) { - Factions.get().log(fme.getDisplayName() + " kicked " + fplayer.getName() + " from the faction " + fplayerFaction.getTag()); + Factions.get().log(fme.getDisplayName() + " kicked " + uplayer.getName() + " from the faction " + uplayerFaction.getTag()); } // Apply - if (fplayer.getRole() == Rel.LEADER) + if (uplayer.getRole() == Rel.LEADER) { - fplayerFaction.promoteNewLeader(); + uplayerFaction.promoteNewLeader(); } - fplayerFaction.setInvited(fplayer, false); - fplayer.resetFactionData(); + uplayerFaction.setInvited(uplayer, false); + uplayer.resetFactionData(); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsLeader.java b/src/com/massivecraft/factions/cmd/CmdFactionsLeader.java index 6350874d..1de0f0fb 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsLeader.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsLeader.java @@ -2,10 +2,10 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; import com.massivecraft.factions.Rel; -import com.massivecraft.factions.cmd.arg.ARFPlayer; +import com.massivecraft.factions.cmd.arg.ARUPlayer; import com.massivecraft.factions.cmd.arg.ARFaction; -import com.massivecraft.factions.entity.FPlayer; -import com.massivecraft.factions.entity.FPlayerColls; +import com.massivecraft.factions.entity.UPlayer; +import com.massivecraft.factions.entity.UPlayerColls; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.event.FactionsEventMembershipChange; import com.massivecraft.factions.event.FactionsEventMembershipChange.MembershipChangeReason; @@ -28,15 +28,15 @@ public class CmdFactionsLeader extends FCommand @Override public void perform() { - FPlayer newLeader = this.arg(0, ARFPlayer.getStartAny(sender)); + UPlayer newLeader = this.arg(0, ARUPlayer.getStartAny(sender)); if (newLeader == null) return; Faction targetFaction = this.arg(1, ARFaction.get(sender), myFaction); if (targetFaction == null) return; - FPlayer targetFactionCurrentLeader = targetFaction.getLeader(); + UPlayer targetFactionCurrentLeader = targetFaction.getLeader(); - // We now have fplayer and the target faction + // We now have uplayer and the target faction if (this.senderIsConsole || fme.isUsingAdminMode() || Perm.LEADER_ANY.has(sender, false)) { // Do whatever you wish @@ -63,7 +63,7 @@ public class CmdFactionsLeader extends FCommand } } - // only perform a FPlayerJoinEvent when newLeader isn't actually in the faction + // only run event when newLeader isn't actually in the faction if (newLeader.getFaction() != targetFaction) { FactionsEventMembershipChange event = new FactionsEventMembershipChange(sender, newLeader, targetFaction, MembershipChangeReason.LEADER); @@ -90,9 +90,9 @@ public class CmdFactionsLeader extends FCommand msg("You have promoted %s to the position of faction leader.", newLeader.describeTo(fme, true)); // Inform all players - for (FPlayer fplayer : FPlayerColls.get().get(sender).getAllOnline()) + for (UPlayer uplayer : UPlayerColls.get().get(sender).getAllOnline()) { - fplayer.msg("%s gave %s the leadership of %s.", senderIsConsole ? "A server admin" : RelationUtil.describeThatToMe(fme, fplayer, true), newLeader.describeTo(fplayer), targetFaction.describeTo(fplayer)); + uplayer.msg("%s gave %s the leadership of %s.", senderIsConsole ? "A server admin" : RelationUtil.describeThatToMe(fme, uplayer, true), newLeader.describeTo(uplayer), targetFaction.describeTo(uplayer)); } } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsList.java b/src/com/massivecraft/factions/cmd/CmdFactionsList.java index bbc13a68..b50ad6ee 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsList.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsList.java @@ -53,13 +53,13 @@ public class CmdFactionsList extends FCommand { if (faction.isNone()) { - lines.add(Txt.parse("Factionless %d online", FactionColls.get().get(sender).getNone().getFPlayersWhereOnline(true).size())); + lines.add(Txt.parse("Factionless %d online", FactionColls.get().get(sender).getNone().getUPlayersWhereOnline(true).size())); continue; } lines.add(Txt.parse("%s %d/%d online, %d/%d/%d", faction.getTag(fme), - faction.getFPlayersWhereOnline(true).size(), - faction.getFPlayers().size(), + faction.getUPlayersWhereOnline(true).size(), + faction.getUPlayers().size(), faction.getLandCount(), faction.getPowerRounded(), faction.getPowerMaxRounded()) diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFp.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFp.java index 07fad45a..f30ec06a 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFp.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFp.java @@ -1,10 +1,10 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARFPlayer; +import com.massivecraft.factions.cmd.arg.ARUPlayer; import com.massivecraft.factions.cmd.arg.ARFaction; import com.massivecraft.factions.cmd.req.ReqBankCommandsEnabled; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.Factions; @@ -40,7 +40,7 @@ public class CmdFactionsMoneyTransferFp extends FCommand Faction from = this.arg(1, ARFaction.get(sender)); if (from == null) return; - FPlayer to = this.arg(2, ARFPlayer.getStartAny(sender)); + UPlayer to = this.arg(2, ARUPlayer.getStartAny(sender)); if (to == null) return; boolean success = Econ.transferMoney(fme, from, to, amount); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferPf.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferPf.java index c93143b3..e5ab6d66 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferPf.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferPf.java @@ -1,10 +1,10 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARFPlayer; +import com.massivecraft.factions.cmd.arg.ARUPlayer; import com.massivecraft.factions.cmd.arg.ARFaction; import com.massivecraft.factions.cmd.req.ReqBankCommandsEnabled; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.Factions; @@ -37,7 +37,7 @@ public class CmdFactionsMoneyTransferPf extends FCommand Double amount = this.arg(0, ARDouble.get()); if (amount == null) return; - FPlayer from = this.arg(1, ARFPlayer.getStartAny(sender)); + UPlayer from = this.arg(1, ARUPlayer.getStartAny(sender)); if (from == null) return; Faction to = this.arg(2, ARFaction.get(sender)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyWithdraw.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyWithdraw.java index 2860e160..9ae37d16 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyWithdraw.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyWithdraw.java @@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; import com.massivecraft.factions.cmd.arg.ARFaction; import com.massivecraft.factions.cmd.req.ReqBankCommandsEnabled; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.Factions; @@ -38,7 +38,7 @@ public class CmdFactionsMoneyWithdraw extends FCommand Faction from = this.arg(1, ARFaction.get(sender), myFaction); if (from == null) return; - FPlayer to = fme; + UPlayer to = fme; boolean success = Econ.transferMoney(fme, from, to, amount); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsOfficer.java b/src/com/massivecraft/factions/cmd/CmdFactionsOfficer.java index f853f6ed..88cbad53 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsOfficer.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsOfficer.java @@ -2,8 +2,8 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; import com.massivecraft.factions.Rel; -import com.massivecraft.factions.cmd.arg.ARFPlayer; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.cmd.arg.ARUPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.mcore.cmd.req.ReqHasPerm; @@ -22,7 +22,7 @@ public class CmdFactionsOfficer extends FCommand @Override public void perform() { - FPlayer you = this.arg(0, ARFPlayer.getStartAny(sender)); + UPlayer you = this.arg(0, ARUPlayer.getStartAny(sender)); if (you == null) return; boolean permAny = Perm.OFFICER_ANY.has(sender, false); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPower.java b/src/com/massivecraft/factions/cmd/CmdFactionsPower.java index 4c191b79..563f6d65 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPower.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPower.java @@ -1,8 +1,8 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARFPlayer; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.cmd.arg.ARUPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.mcore.cmd.req.ReqHasPerm; public class CmdFactionsPower extends FCommand @@ -20,7 +20,7 @@ public class CmdFactionsPower extends FCommand @Override public void perform() { - FPlayer target = this.arg(0, ARFPlayer.getStartAny(fme), fme); + UPlayer target = this.arg(0, ARUPlayer.getStartAny(fme), fme); if (target == null) return; if (target != fme && ! Perm.POWER_ANY.has(sender, true)) return; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java b/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java index 5462b742..11879497 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java @@ -2,9 +2,9 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Perm; -import com.massivecraft.factions.cmd.arg.ARFPlayer; +import com.massivecraft.factions.cmd.arg.ARUPlayer; import com.massivecraft.factions.cmd.arg.ARFaction; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.mcore.cmd.arg.ARDouble; import com.massivecraft.mcore.cmd.req.ReqHasPerm; @@ -45,7 +45,7 @@ public class CmdFactionsPowerBoost extends FCommand if (doPlayer) { - FPlayer targetPlayer = this.arg(1, ARFPlayer.getStartAny(sender)); + UPlayer targetPlayer = this.arg(1, ARUPlayer.getStartAny(sender)); if (targetPlayer == null) return; targetPlayer.setPowerBoost(targetPower); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPromote.java b/src/com/massivecraft/factions/cmd/CmdFactionsPromote.java index 767e6058..80e32c7a 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPromote.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPromote.java @@ -2,8 +2,8 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Perm; import com.massivecraft.factions.Rel; -import com.massivecraft.factions.cmd.arg.ARFPlayer; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.cmd.arg.ARUPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.mcore.cmd.req.ReqHasPerm; public class CmdFactionsPromote extends FCommand @@ -25,7 +25,7 @@ public class CmdFactionsPromote extends FCommand @Override public void perform() { - FPlayer you = this.arg(0, ARFPlayer.getStartAny(sender)); + UPlayer you = this.arg(0, ARUPlayer.getStartAny(sender)); if (you == null) return; if (you.getFaction() != myFaction) diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsShow.java b/src/com/massivecraft/factions/cmd/CmdFactionsShow.java index c108d987..4e22857a 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsShow.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsShow.java @@ -7,7 +7,7 @@ import java.util.Map; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.cmd.arg.ARFaction; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.integration.Econ; import com.massivecraft.factions.FFlag; @@ -35,10 +35,10 @@ public class CmdFactionsShow extends FCommand Faction faction = this.arg(0, ARFaction.get(myFaction), myFaction); if (faction == null) return; - Collection leaders = faction.getFPlayersWhereRole(Rel.LEADER); - Collection officers = faction.getFPlayersWhereRole(Rel.OFFICER); - Collection normals = faction.getFPlayersWhereRole(Rel.MEMBER); - Collection recruits = faction.getFPlayersWhereRole(Rel.RECRUIT); + Collection leaders = faction.getUPlayersWhereRole(Rel.LEADER); + Collection officers = faction.getUPlayersWhereRole(Rel.OFFICER); + Collection normals = faction.getUPlayersWhereRole(Rel.MEMBER); + Collection recruits = faction.getUPlayersWhereRole(Rel.RECRUIT); msg(Txt.titleize(faction.getTag(fme))); msg("Description: %s", faction.getDescription()); @@ -101,7 +101,7 @@ public class CmdFactionsShow extends FCommand List memberOnlineNames = new ArrayList(); List memberOfflineNames = new ArrayList(); - for (FPlayer follower : leaders) + for (UPlayer follower : leaders) { if (follower.isOnline() && Mixin.isVisible(me, follower.getId())) { @@ -113,7 +113,7 @@ public class CmdFactionsShow extends FCommand } } - for (FPlayer follower : officers) + for (UPlayer follower : officers) { if (follower.isOnline() && Mixin.isVisible(me, follower.getId())) { @@ -125,7 +125,7 @@ public class CmdFactionsShow extends FCommand } } - for (FPlayer follower : normals) + for (UPlayer follower : normals) { if (follower.isOnline() && Mixin.isVisible(me, follower.getId())) { @@ -137,7 +137,7 @@ public class CmdFactionsShow extends FCommand } } - for (FPlayer follower : recruits) + for (UPlayer follower : recruits) { if (follower.isOnline()) { diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsTitle.java b/src/com/massivecraft/factions/cmd/CmdFactionsTitle.java index 0f4de9b4..b9525231 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsTitle.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsTitle.java @@ -3,9 +3,9 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.Perm; import com.massivecraft.factions.Rel; -import com.massivecraft.factions.cmd.arg.ARFPlayer; +import com.massivecraft.factions.cmd.arg.ARUPlayer; import com.massivecraft.factions.cmd.req.ReqRoleIsAtLeast; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.event.FactionsEventTitleChange; import com.massivecraft.factions.integration.SpoutFeatures; import com.massivecraft.mcore.cmd.arg.ARString; @@ -28,7 +28,7 @@ public class CmdFactionsTitle extends FCommand public void perform() { // Args - FPlayer you = this.arg(0, ARFPlayer.getStartAny(sender)); + UPlayer you = this.arg(0, ARUPlayer.getStartAny(sender)); if (you == null) return; String newTitle = this.argConcatFrom(1, ARString.get(), ""); diff --git a/src/com/massivecraft/factions/cmd/FCommand.java b/src/com/massivecraft/factions/cmd/FCommand.java index 18f7936c..23ac83f7 100644 --- a/src/com/massivecraft/factions/cmd/FCommand.java +++ b/src/com/massivecraft/factions/cmd/FCommand.java @@ -1,20 +1,20 @@ package com.massivecraft.factions.cmd; import com.massivecraft.factions.Rel; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.mcore.cmd.MCommand; import com.massivecraft.mcore.util.Txt; public abstract class FCommand extends MCommand { - public FPlayer fme; + public UPlayer fme; public Faction myFaction; @Override public void fixSenderVars() { - this.fme = FPlayer.get(this.sender); + this.fme = UPlayer.get(this.sender); this.myFaction = this.fme.getFaction(); } @@ -22,7 +22,7 @@ public abstract class FCommand extends MCommand // COMMONLY USED LOGIC // -------------------------------------------- // - public boolean canIAdministerYou(FPlayer i, FPlayer you) + public boolean canIAdministerYou(UPlayer i, UPlayer you) { if ( ! i.getFaction().equals(you.getFaction())) { diff --git a/src/com/massivecraft/factions/cmd/arg/ARFPlayer.java b/src/com/massivecraft/factions/cmd/arg/ARFPlayer.java deleted file mode 100644 index c0dae209..00000000 --- a/src/com/massivecraft/factions/cmd/arg/ARFPlayer.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.massivecraft.factions.cmd.arg; - -import com.massivecraft.factions.entity.FPlayer; -import com.massivecraft.factions.entity.FPlayerColls; -import com.massivecraft.mcore.cmd.arg.ARSenderEntity; -import com.massivecraft.mcore.cmd.arg.ArgReader; - -public class ARFPlayer -{ - // -------------------------------------------- // - // INSTANCE - // -------------------------------------------- // - - public static ArgReader getFullAny(Object o) { return ARSenderEntity.getFullAny(FPlayerColls.get().get(o)); } - - public static ArgReader getStartAny(Object o) { return ARSenderEntity.getStartAny(FPlayerColls.get().get(o)); } - - public static ArgReader getFullOnline(Object o) { return ARSenderEntity.getFullOnline(FPlayerColls.get().get(o)); } - - public static ArgReader getStartOnline(Object o) { return ARSenderEntity.getStartOnline(FPlayerColls.get().get(o)); } - -} diff --git a/src/com/massivecraft/factions/cmd/arg/ARFaction.java b/src/com/massivecraft/factions/cmd/arg/ARFaction.java index 62c99cc3..6a4ade32 100644 --- a/src/com/massivecraft/factions/cmd/arg/ARFaction.java +++ b/src/com/massivecraft/factions/cmd/arg/ARFaction.java @@ -2,8 +2,8 @@ package com.massivecraft.factions.cmd.arg; import org.bukkit.command.CommandSender; -import com.massivecraft.factions.entity.FPlayer; -import com.massivecraft.factions.entity.FPlayerColls; +import com.massivecraft.factions.entity.UPlayer; +import com.massivecraft.factions.entity.UPlayerColls; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.FactionColl; import com.massivecraft.factions.entity.FactionColls; @@ -47,11 +47,11 @@ public class ARFaction extends ArgReaderAbstract result.setResult(this.getColl().getBestTagMatch(str)); if (result.hasResult()) return result; - // FPlayer Name Exact - FPlayer fplayer = FPlayerColls.get().get(this.getColl()).get(str); - if (fplayer != null) + // UPlayer Name Exact + UPlayer uplayer = UPlayerColls.get().get(this.getColl()).get(str); + if (uplayer != null) { - result.setResult(fplayer.getFaction()); + result.setResult(uplayer.getFaction()); return result; } diff --git a/src/com/massivecraft/factions/cmd/arg/ARUPlayer.java b/src/com/massivecraft/factions/cmd/arg/ARUPlayer.java new file mode 100644 index 00000000..662da45b --- /dev/null +++ b/src/com/massivecraft/factions/cmd/arg/ARUPlayer.java @@ -0,0 +1,22 @@ +package com.massivecraft.factions.cmd.arg; + +import com.massivecraft.factions.entity.UPlayer; +import com.massivecraft.factions.entity.UPlayerColls; +import com.massivecraft.mcore.cmd.arg.ARSenderEntity; +import com.massivecraft.mcore.cmd.arg.ArgReader; + +public class ARUPlayer +{ + // -------------------------------------------- // + // INSTANCE + // -------------------------------------------- // + + public static ArgReader getFullAny(Object o) { return ARSenderEntity.getFullAny(UPlayerColls.get().get(o)); } + + public static ArgReader getStartAny(Object o) { return ARSenderEntity.getStartAny(UPlayerColls.get().get(o)); } + + public static ArgReader getFullOnline(Object o) { return ARSenderEntity.getFullOnline(UPlayerColls.get().get(o)); } + + public static ArgReader getStartOnline(Object o) { return ARSenderEntity.getStartOnline(UPlayerColls.get().get(o)); } + +} diff --git a/src/com/massivecraft/factions/cmd/req/ReqRoleIsAtLeast.java b/src/com/massivecraft/factions/cmd/req/ReqRoleIsAtLeast.java index b3cb1a78..3c0ba854 100644 --- a/src/com/massivecraft/factions/cmd/req/ReqRoleIsAtLeast.java +++ b/src/com/massivecraft/factions/cmd/req/ReqRoleIsAtLeast.java @@ -3,7 +3,7 @@ package com.massivecraft.factions.cmd.req; import org.bukkit.command.CommandSender; import com.massivecraft.factions.Rel; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.mcore.cmd.MCommand; import com.massivecraft.mcore.cmd.req.ReqAbstract; import com.massivecraft.mcore.util.Txt; @@ -33,8 +33,8 @@ public class ReqRoleIsAtLeast extends ReqAbstract @Override public boolean apply(CommandSender sender, MCommand command) { - FPlayer fplayer = FPlayer.get(sender); - return fplayer.getRole().isAtLeast(this.rel); + UPlayer uplayer = UPlayer.get(sender); + return uplayer.getRole().isAtLeast(this.rel); } @Override diff --git a/src/com/massivecraft/factions/entity/Faction.java b/src/com/massivecraft/factions/entity/Faction.java index 21949d95..2da68b7e 100644 --- a/src/com/massivecraft/factions/entity/Faction.java +++ b/src/com/massivecraft/factions/entity/Faction.java @@ -350,9 +350,9 @@ public class Faction extends Entity implements EconomyParticipator return this.getInvitedPlayerIds().contains(playerId); } - public boolean isInvited(FPlayer fplayer) + public boolean isInvited(UPlayer uplayer) { - return this.isInvited(fplayer.getId()); + return this.isInvited(uplayer.getId()); } public boolean setInvited(String playerId, boolean invited) @@ -372,9 +372,9 @@ public class Faction extends Entity implements EconomyParticipator } - public void setInvited(FPlayer fplayer, boolean invited) + public void setInvited(UPlayer uplayer, boolean invited) { - this.setInvited(fplayer.getId(), invited); + this.setInvited(uplayer.getId(), invited); } // -------------------------------------------- // @@ -673,9 +673,9 @@ public class Faction extends Entity implements EconomyParticipator } double ret = 0; - for (FPlayer fplayer : this.getFPlayers()) + for (UPlayer uplayer : this.getUPlayers()) { - ret += fplayer.getPower(); + ret += uplayer.getPower(); } if (UConf.get(this).powerFactionMax > 0 && ret > UConf.get(this).powerFactionMax) @@ -694,9 +694,9 @@ public class Faction extends Entity implements EconomyParticipator } double ret = 0; - for (FPlayer fplayer : this.getFPlayers()) + for (UPlayer uplayer : this.getUPlayers()) { - ret += fplayer.getPowerMax(); + ret += uplayer.getPowerMax(); } if (UConf.get(this).powerFactionMax > 0 && ret > UConf.get(this).powerFactionMax) @@ -732,41 +732,37 @@ public class Faction extends Entity implements EconomyParticipator } // -------------------------------------------- // - // FOREIGN KEYS: FPLAYERS + // FOREIGN KEY: UPLAYER // -------------------------------------------- // - - // TODO: With this approach null must be used as default always. - // TODO: Take a moment and reflect upon the consequenses eeeeeeh... - // TODO: This one may be to slow after all :/ Thus I must maintain an index. - protected transient List fplayers = null; - public void reindexFPlayers() + protected transient List uplayers = null; + public void reindexUPlayers() { - this.fplayers = new ArrayList(); + this.uplayers = new ArrayList(); String factionId = this.getId(); if (factionId == null) return; - for (FPlayer fplayer : FPlayerColls.get().get(this).getAll()) + for (UPlayer uplayer : UPlayerColls.get().get(this).getAll()) { - if (!MUtil.equals(factionId, fplayer.getFactionId())) continue; - this.fplayers.add(fplayer); + if (!MUtil.equals(factionId, uplayer.getFactionId())) continue; + this.uplayers.add(uplayer); } } - public List getFPlayers() + public List getUPlayers() { - return new ArrayList(this.fplayers); + return new ArrayList(this.uplayers); } - public List getFPlayersWhereOnline(boolean online) + public List getUPlayersWhereOnline(boolean online) { - List ret = this.getFPlayers(); - Iterator iter = ret.iterator(); + List ret = this.getUPlayers(); + Iterator iter = ret.iterator(); while (iter.hasNext()) { - FPlayer fplayer = iter.next(); - if (fplayer.isOnline() != online) + UPlayer uplayer = iter.next(); + if (uplayer.isOnline() != online) { iter.remove(); } @@ -774,14 +770,14 @@ public class Faction extends Entity implements EconomyParticipator return ret; } - public List getFPlayersWhereRole(Rel role) + public List getUPlayersWhereRole(Rel role) { - List ret = this.getFPlayers(); - Iterator iter = ret.iterator(); + List ret = this.getUPlayers(); + Iterator iter = ret.iterator(); while (iter.hasNext()) { - FPlayer fplayer = iter.next(); - if (fplayer.getRole() != role) + UPlayer uplayer = iter.next(); + if (uplayer.getRole() != role) { iter.remove(); } @@ -789,16 +785,16 @@ public class Faction extends Entity implements EconomyParticipator return ret; } - public FPlayer getLeader() + public UPlayer getLeader() { - List ret = this.getFPlayers(); - Iterator iter = ret.iterator(); + List ret = this.getUPlayers(); + Iterator iter = ret.iterator(); while (iter.hasNext()) { - FPlayer fplayer = iter.next(); - if (fplayer.getRole() == Rel.LEADER) + UPlayer uplayer = iter.next(); + if (uplayer.getRole() == Rel.LEADER) { - return fplayer; + return uplayer; } } return null; @@ -809,9 +805,9 @@ public class Faction extends Entity implements EconomyParticipator List ret = new ArrayList(); for (CommandSender player : SenderUtil.getOnlineSenders()) { - FPlayer fplayer = FPlayer.get(player); - if (!MUtil.equals(fplayer.getUniverse(), this.getUniverse())) continue; - if (fplayer.getFaction() != this) continue; + UPlayer uplayer = UPlayer.get(player); + if (!MUtil.equals(uplayer.getUniverse(), this.getUniverse())) continue; + if (uplayer.getFaction() != this) continue; ret.add(player); } return ret; @@ -822,9 +818,9 @@ public class Faction extends Entity implements EconomyParticipator List ret = new ArrayList(); for (Player player : Bukkit.getOnlinePlayers()) { - FPlayer fplayer = FPlayer.get(player); - if (!MUtil.equals(fplayer.getUniverse(), this.getUniverse())) continue; - if (fplayer.getFaction() != this) continue; + UPlayer uplayer = UPlayer.get(player); + if (!MUtil.equals(uplayer.getUniverse(), this.getUniverse())) continue; + if (uplayer.getFaction() != this) continue; ret.add(player); } return ret; @@ -836,13 +832,13 @@ public class Faction extends Entity implements EconomyParticipator if ( ! this.isNormal()) return; if (this.getFlag(FFlag.PERMANENT) && ConfServer.permanentFactionsDisableLeaderPromotion) return; - FPlayer oldLeader = this.getLeader(); + UPlayer oldLeader = this.getLeader(); // get list of officers, or list of normal members if there are no officers - List replacements = this.getFPlayersWhereRole(Rel.OFFICER); + List replacements = this.getUPlayersWhereRole(Rel.OFFICER); if (replacements == null || replacements.isEmpty()) { - replacements = this.getFPlayersWhereRole(Rel.MEMBER); + replacements = this.getUPlayersWhereRole(Rel.MEMBER); } if (replacements == null || replacements.isEmpty()) @@ -862,9 +858,9 @@ public class Faction extends Entity implements EconomyParticipator Factions.get().log("The faction "+this.getTag()+" ("+this.getId()+") has been disbanded since it has no members left."); } - for (FPlayer fplayer : FPlayerColls.get().get(this).getAllOnline()) + for (UPlayer uplayer : UPlayerColls.get().get(this).getAllOnline()) { - fplayer.msg("The faction %s was disbanded.", this.getTag(fplayer)); + uplayer.msg("The faction %s was disbanded.", this.getTag(uplayer)); } this.detach(); diff --git a/src/com/massivecraft/factions/entity/FactionColl.java b/src/com/massivecraft/factions/entity/FactionColl.java index 7c164ec3..e53dd9c9 100644 --- a/src/com/massivecraft/factions/entity/FactionColl.java +++ b/src/com/massivecraft/factions/entity/FactionColl.java @@ -76,8 +76,8 @@ public class FactionColl extends Coll // Clean the board BoardColls.get().getForUniverse(universe).clean(); - // Clean the fplayers - FPlayerColls.get().getForUniverse(universe).clean(); + // Clean the uplayers + UPlayerColls.get().getForUniverse(universe).clean(); return ret; } @@ -90,7 +90,7 @@ public class FactionColl extends Coll { for (Faction faction : this.getAll()) { - faction.reindexFPlayers(); + faction.reindexUPlayers(); } } @@ -193,10 +193,10 @@ public class FactionColl extends Coll int landCount = faction.getLandCount(); if (!faction.getFlag(FFlag.PEACEFUL) && landCount > 0) { - List players = faction.getFPlayers(); + List players = faction.getUPlayers(); int playerCount = players.size(); double reward = ConfServer.econLandReward * landCount / playerCount; - for (FPlayer player : players) + for (UPlayer player : players) { Econ.modifyMoney(player, reward, "own " + landCount + " faction land divided among " + playerCount + " members"); } diff --git a/src/com/massivecraft/factions/entity/FactionColls.java b/src/com/massivecraft/factions/entity/FactionColls.java index 2591c191..2df45095 100644 --- a/src/com/massivecraft/factions/entity/FactionColls.java +++ b/src/com/massivecraft/factions/entity/FactionColls.java @@ -115,7 +115,7 @@ public class FactionColls extends Colls // INDEX // -------------------------------------------- // - public void reindexFPlayers() + public void reindexUPlayers() { for (FactionColl coll : this.getColls()) { diff --git a/src/com/massivecraft/factions/entity/FPlayer.java b/src/com/massivecraft/factions/entity/UPlayer.java similarity index 95% rename from src/com/massivecraft/factions/entity/FPlayer.java rename to src/com/massivecraft/factions/entity/UPlayer.java index bbc8691f..351f0375 100644 --- a/src/com/massivecraft/factions/entity/FPlayer.java +++ b/src/com/massivecraft/factions/entity/UPlayer.java @@ -34,15 +34,15 @@ import com.massivecraft.mcore.util.TimeUnit; import com.massivecraft.mcore.util.Txt; -public class FPlayer extends SenderEntity implements EconomyParticipator +public class UPlayer extends SenderEntity implements EconomyParticipator { // -------------------------------------------- // // META // -------------------------------------------- // - public static FPlayer get(Object oid) + public static UPlayer get(Object oid) { - return FPlayerColls.get().get2(oid); + return UPlayerColls.get().get2(oid); } // -------------------------------------------- // @@ -50,7 +50,7 @@ public class FPlayer extends SenderEntity implements EconomyParticipato // -------------------------------------------- // @Override - public FPlayer load(FPlayer that) + public UPlayer load(UPlayer that) { this.setFactionId(that.factionId); this.setRole(that.role); @@ -151,7 +151,7 @@ public class FPlayer extends SenderEntity implements EconomyParticipato // -------------------------------------------- // // GSON need this noarg constructor. - public FPlayer() + public UPlayer() { this.resetFactionData(false); //this.power = ConfServer.powerStarting; @@ -238,8 +238,8 @@ public class FPlayer extends SenderEntity implements EconomyParticipato Faction oldFaction = FactionColls.get().get(this).get(oldFactionId); Faction faction = FactionColls.get().get(this).get(factionId); - oldFaction.fplayers.remove(this); - faction.fplayers.add(this); + oldFaction.uplayers.remove(this); + faction.uplayers.add(this); // Mark as changed this.changed(); @@ -418,7 +418,7 @@ public class FPlayer extends SenderEntity implements EconomyParticipato if (online) { Player thisPlayer = this.getPlayer(); - online = (thisPlayer != null && !thisPlayer.isDead() && FPlayer.get(thisPlayer) == this); + online = (thisPlayer != null && !thisPlayer.isDead() && UPlayer.get(thisPlayer) == this); } // Cache and prepare @@ -564,9 +564,9 @@ public class FPlayer extends SenderEntity implements EconomyParticipato { return this.getColorTo(faction)+this.getNameAndTitle(); } - public String getNameAndTitle(FPlayer fplayer) + public String getNameAndTitle(UPlayer uplayer) { - return this.getColorTo(fplayer)+this.getNameAndTitle(); + return this.getColorTo(uplayer)+this.getNameAndTitle(); } // -------------------------------------------- // @@ -664,7 +664,7 @@ public class FPlayer extends SenderEntity implements EconomyParticipato boolean permanent = myFaction.getFlag(FFlag.PERMANENT); - if (!permanent && this.getRole() == Rel.LEADER && myFaction.getFPlayers().size() > 1) + if (!permanent && this.getRole() == Rel.LEADER && myFaction.getUPlayers().size() > 1) { msg("You must give the leader role to someone else first."); return; @@ -682,7 +682,7 @@ public class FPlayer extends SenderEntity implements EconomyParticipato if (membershipChangeEvent.isCancelled()) return; // Am I the last one in the faction? - if (myFaction.getFPlayers().size() == 1) + if (myFaction.getUPlayers().size() == 1) { // Transfer all money if (Econ.isEnabled(this)) @@ -693,9 +693,9 @@ public class FPlayer extends SenderEntity implements EconomyParticipato if (myFaction.isNormal()) { - for (FPlayer fplayer : myFaction.getFPlayersWhereOnline(true)) + for (UPlayer uplayer : myFaction.getUPlayersWhereOnline(true)) { - fplayer.msg("%s left %s.", this.describeTo(fplayer, true), myFaction.describeTo(fplayer)); + uplayer.msg("%s left %s.", this.describeTo(uplayer, true), myFaction.describeTo(uplayer)); } if (MConf.get().logFactionLeave) @@ -706,12 +706,12 @@ public class FPlayer extends SenderEntity implements EconomyParticipato this.resetFactionData(); - if (myFaction.isNormal() && !permanent && myFaction.getFPlayers().isEmpty()) + if (myFaction.isNormal() && !permanent && myFaction.getUPlayers().isEmpty()) { // Remove this faction - for (FPlayer fplayer : FPlayerColls.get().get(this).getAllOnline()) + for (UPlayer uplayer : UPlayerColls.get().get(this).getAllOnline()) { - fplayer.msg("%s was disbanded.", myFaction.describeTo(fplayer, true)); + uplayer.msg("%s was disbanded.", myFaction.describeTo(uplayer, true)); } myFaction.detach(); @@ -751,7 +751,7 @@ public class FPlayer extends SenderEntity implements EconomyParticipato { return false; } - else if (forFaction.getFPlayers().size() < ConfServer.claimsRequireMinFactionMembers) + else if (forFaction.getUPlayers().size() < ConfServer.claimsRequireMinFactionMembers) { error = Txt.parse("Factions must have at least %s members to claim land.", ConfServer.claimsRequireMinFactionMembers); } @@ -837,10 +837,10 @@ public class FPlayer extends SenderEntity implements EconomyParticipato } // announce success - Set informTheseFPlayers = new HashSet(); - informTheseFPlayers.add(this); - informTheseFPlayers.addAll(forFaction.getFPlayersWhereOnline(true)); - for (FPlayer fp : informTheseFPlayers) + Set informTheseUPlayers = new HashSet(); + informTheseUPlayers.add(this); + informTheseUPlayers.addAll(forFaction.getUPlayersWhereOnline(true)); + for (UPlayer fp : informTheseUPlayers) { fp.msg("%s claimed land for %s from %s.", this.describeTo(fp, true), forFaction.describeTo(fp), currentFaction.describeTo(fp)); } diff --git a/src/com/massivecraft/factions/entity/FPlayerColl.java b/src/com/massivecraft/factions/entity/UPlayerColl.java similarity index 65% rename from src/com/massivecraft/factions/entity/FPlayerColl.java rename to src/com/massivecraft/factions/entity/UPlayerColl.java index 8b8b1901..c9835713 100644 --- a/src/com/massivecraft/factions/entity/FPlayerColl.java +++ b/src/com/massivecraft/factions/entity/UPlayerColl.java @@ -8,15 +8,15 @@ import com.massivecraft.mcore.store.MStore; import com.massivecraft.mcore.store.SenderColl; import com.massivecraft.mcore.util.TimeUnit; -public class FPlayerColl extends SenderColl +public class UPlayerColl extends SenderColl { // -------------------------------------------- // // CONSTRUCT // -------------------------------------------- // - public FPlayerColl(String name) + public UPlayerColl(String name) { - super(name, FPlayer.class, MStore.getDb(ConfServer.dburi), Factions.get()); + super(name, UPlayer.class, MStore.getDb(ConfServer.dburi), Factions.get()); } // -------------------------------------------- // @@ -24,7 +24,7 @@ public class FPlayerColl extends SenderColl // -------------------------------------------- // @Override - protected synchronized String attach(FPlayer entity, Object oid, boolean noteChange) + protected synchronized String attach(UPlayer entity, Object oid, boolean noteChange) { String ret = super.attach(entity, oid, noteChange); @@ -34,15 +34,15 @@ public class FPlayerColl extends SenderColl // ... update the index. Faction faction = entity.getFaction(); - faction.fplayers.add(entity); + faction.uplayers.add(entity); return ret; } @Override - public FPlayer detachId(Object oid) + public UPlayer detachId(Object oid) { - FPlayer ret = super.detachId(oid); + UPlayer ret = super.detachId(oid); if (ret == null) return null; // If inited ... @@ -50,7 +50,7 @@ public class FPlayerColl extends SenderColl // ... update the index. Faction faction = ret.getFaction(); - faction.fplayers.remove(ret); + faction.uplayers.remove(ret); return ret; } @@ -61,12 +61,12 @@ public class FPlayerColl extends SenderColl public void clean() { - for (FPlayer fplayer : this.getAll()) + for (UPlayer uplayer : this.getAll()) { - if (FactionColls.get().get(this).containsId(fplayer.getFactionId())) continue; + if (FactionColls.get().get(this).containsId(uplayer.getFactionId())) continue; - Factions.get().log("Reset faction data (invalid faction) for player "+fplayer.getName()); - fplayer.resetFactionData(false); + Factions.get().log("Reset faction data (invalid faction) for player "+uplayer.getName()); + uplayer.resetFactionData(false); } } @@ -77,31 +77,31 @@ public class FPlayerColl extends SenderColl long now = System.currentTimeMillis(); double toleranceMillis = ConfServer.autoLeaveAfterDaysOfInactivity * TimeUnit.MILLIS_PER_DAY; - for (FPlayer fplayer : this.getAll()) + for (UPlayer uplayer : this.getAll()) { - Long lastPlayed = Mixin.getLastPlayed(fplayer.getId()); + Long lastPlayed = Mixin.getLastPlayed(uplayer.getId()); if (lastPlayed == null) continue; - if (fplayer.isOnline()) continue; + if (uplayer.isOnline()) continue; if (now - lastPlayed <= toleranceMillis) continue; if (MConf.get().logFactionLeave || MConf.get().logFactionKick) { - Factions.get().log("Player "+fplayer.getName()+" was auto-removed due to inactivity."); + Factions.get().log("Player "+uplayer.getName()+" was auto-removed due to inactivity."); } // if player is faction leader, sort out the faction since he's going away - if (fplayer.getRole() == Rel.LEADER) + if (uplayer.getRole() == Rel.LEADER) { - Faction faction = fplayer.getFaction(); + Faction faction = uplayer.getFaction(); if (faction != null) { - fplayer.getFaction().promoteNewLeader(); + uplayer.getFaction().promoteNewLeader(); } } - fplayer.leave(false); - fplayer.detach(); + uplayer.leave(false); + uplayer.detach(); } } } diff --git a/src/com/massivecraft/factions/entity/FPlayerColls.java b/src/com/massivecraft/factions/entity/UPlayerColls.java similarity index 75% rename from src/com/massivecraft/factions/entity/FPlayerColls.java rename to src/com/massivecraft/factions/entity/UPlayerColls.java index 93bf8608..6fec5fa8 100644 --- a/src/com/massivecraft/factions/entity/FPlayerColls.java +++ b/src/com/massivecraft/factions/entity/UPlayerColls.java @@ -19,23 +19,23 @@ import com.massivecraft.mcore.util.MUtil; import com.massivecraft.mcore.util.SenderUtil; import com.massivecraft.mcore.xlib.gson.reflect.TypeToken; -public class FPlayerColls extends Colls +public class UPlayerColls extends Colls { // -------------------------------------------- // // INSTANCE & CONSTRUCT // -------------------------------------------- // - private static FPlayerColls i = new FPlayerColls(); - public static FPlayerColls get() { return i; } + private static UPlayerColls i = new UPlayerColls(); + public static UPlayerColls get() { return i; } // -------------------------------------------- // // OVERRIDE: COLLS // -------------------------------------------- // @Override - public FPlayerColl createColl(String collName) + public UPlayerColl createColl(String collName) { - return new FPlayerColl(collName); + return new UPlayerColl(collName); } @Override @@ -47,11 +47,11 @@ public class FPlayerColls extends Colls @Override public String getBasename() { - return Const.COLLECTION_BASENAME_PLAYER; + return Const.COLLECTION_BASENAME_UPLAYER; } @Override - public FPlayerColl get(Object o) + public UPlayerColl get(Object o) { if (o == null) return null; @@ -93,17 +93,17 @@ public class FPlayerColls extends Colls if ( ! oldFile.exists()) return; // Read the file content through GSON. - Type type = new TypeToken>(){}.getType(); - Map id2fplayer = Factions.get().gson.fromJson(DiscUtil.readCatch(oldFile), type); + Type type = new TypeToken>(){}.getType(); + Map id2fplayer = Factions.get().gson.fromJson(DiscUtil.readCatch(oldFile), type); // The Coll - FPlayerColl coll = this.getForUniverse(MCore.DEFAULT); + UPlayerColl coll = this.getForUniverse(MCore.DEFAULT); // Set the data - for (Entry entry : id2fplayer.entrySet()) + for (Entry entry : id2fplayer.entrySet()) { String playerId = entry.getKey(); - FPlayer fplayer = entry.getValue(); + UPlayer fplayer = entry.getValue(); coll.attach(fplayer, playerId); } diff --git a/src/com/massivecraft/factions/event/FactionsEventAbstractSender.java b/src/com/massivecraft/factions/event/FactionsEventAbstractSender.java index 0e2a64d8..fd38499f 100644 --- a/src/com/massivecraft/factions/event/FactionsEventAbstractSender.java +++ b/src/com/massivecraft/factions/event/FactionsEventAbstractSender.java @@ -2,7 +2,7 @@ package com.massivecraft.factions.event; import org.bukkit.command.CommandSender; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.mcore.event.MCoreEvent; public abstract class FactionsEventAbstractSender extends MCoreEvent @@ -13,7 +13,7 @@ public abstract class FactionsEventAbstractSender extends MCoreEvent private final CommandSender sender; public CommandSender getSender() { return this.sender; } - public FPlayer getFSender() { return FPlayer.get(this.sender); } + public UPlayer getFSender() { return UPlayer.get(this.sender); } // -------------------------------------------- // // CONSTRUCT diff --git a/src/com/massivecraft/factions/event/FactionsEventInvitedChange.java b/src/com/massivecraft/factions/event/FactionsEventInvitedChange.java index 3114e869..369c5475 100644 --- a/src/com/massivecraft/factions/event/FactionsEventInvitedChange.java +++ b/src/com/massivecraft/factions/event/FactionsEventInvitedChange.java @@ -3,7 +3,7 @@ package com.massivecraft.factions.event; import org.bukkit.command.CommandSender; import org.bukkit.event.HandlerList; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.Faction; public class FactionsEventInvitedChange extends FactionsEventAbstractSender @@ -20,8 +20,8 @@ public class FactionsEventInvitedChange extends FactionsEventAbstractSender // FIELDS // -------------------------------------------- // - private final FPlayer fplayer; - public FPlayer getFPlayer() { return this.fplayer; } + private final UPlayer fplayer; + public UPlayer getFPlayer() { return this.fplayer; } private final Faction faction; public Faction getFaction() { return this.faction; } @@ -34,7 +34,7 @@ public class FactionsEventInvitedChange extends FactionsEventAbstractSender // CONSTRUCT // -------------------------------------------- // - public FactionsEventInvitedChange(CommandSender sender, FPlayer fplayer, Faction faction, boolean newInvited) + public FactionsEventInvitedChange(CommandSender sender, UPlayer fplayer, Faction faction, boolean newInvited) { super(sender); this.fplayer = fplayer; diff --git a/src/com/massivecraft/factions/event/FactionsEventMembershipChange.java b/src/com/massivecraft/factions/event/FactionsEventMembershipChange.java index 13f8aec0..aad3d721 100644 --- a/src/com/massivecraft/factions/event/FactionsEventMembershipChange.java +++ b/src/com/massivecraft/factions/event/FactionsEventMembershipChange.java @@ -3,7 +3,7 @@ package com.massivecraft.factions.event; import org.bukkit.command.CommandSender; import org.bukkit.event.HandlerList; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.Faction; public class FactionsEventMembershipChange extends FactionsEventAbstractSender @@ -27,8 +27,8 @@ public class FactionsEventMembershipChange extends FactionsEventAbstractSender super.setCancelled(cancelled); } - private final FPlayer fplayer; - public FPlayer getFPlayer() { return this.fplayer; } + private final UPlayer fplayer; + public UPlayer getFPlayer() { return this.fplayer; } private final Faction newFaction; public Faction getNewFaction() { return this.newFaction; } @@ -40,7 +40,7 @@ public class FactionsEventMembershipChange extends FactionsEventAbstractSender // CONSTRUCT // -------------------------------------------- // - public FactionsEventMembershipChange(CommandSender sender, FPlayer fplayer, Faction newFaction, MembershipChangeReason reason) + public FactionsEventMembershipChange(CommandSender sender, UPlayer fplayer, Faction newFaction, MembershipChangeReason reason) { super(sender); this.fplayer = fplayer; diff --git a/src/com/massivecraft/factions/event/FactionsEventPowerChange.java b/src/com/massivecraft/factions/event/FactionsEventPowerChange.java index 7c4c542e..e5d72ec1 100644 --- a/src/com/massivecraft/factions/event/FactionsEventPowerChange.java +++ b/src/com/massivecraft/factions/event/FactionsEventPowerChange.java @@ -3,7 +3,7 @@ package com.massivecraft.factions.event; import org.bukkit.command.CommandSender; import org.bukkit.event.HandlerList; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; public class FactionsEventPowerChange extends FactionsEventAbstractSender { @@ -19,8 +19,8 @@ public class FactionsEventPowerChange extends FactionsEventAbstractSender // FIELDS // -------------------------------------------- // - private final FPlayer fplayer; - public FPlayer getFPlayer() { return this.fplayer; } + private final UPlayer fplayer; + public UPlayer getFPlayer() { return this.fplayer; } private final PowerChangeReason reason; public PowerChangeReason getReason() { return this.reason; } @@ -33,7 +33,7 @@ public class FactionsEventPowerChange extends FactionsEventAbstractSender // CONSTRUCT // -------------------------------------------- // - public FactionsEventPowerChange(CommandSender sender, FPlayer fplayer, PowerChangeReason reason, double newPower) + public FactionsEventPowerChange(CommandSender sender, UPlayer fplayer, PowerChangeReason reason, double newPower) { super(sender); this.fplayer = fplayer; diff --git a/src/com/massivecraft/factions/event/FactionsEventTitleChange.java b/src/com/massivecraft/factions/event/FactionsEventTitleChange.java index 5262d8c1..e2c9180d 100644 --- a/src/com/massivecraft/factions/event/FactionsEventTitleChange.java +++ b/src/com/massivecraft/factions/event/FactionsEventTitleChange.java @@ -3,7 +3,7 @@ package com.massivecraft.factions.event; import org.bukkit.command.CommandSender; import org.bukkit.event.HandlerList; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; public class FactionsEventTitleChange extends FactionsEventAbstractSender { @@ -19,8 +19,8 @@ public class FactionsEventTitleChange extends FactionsEventAbstractSender // FIELDS // -------------------------------------------- // - private final FPlayer fplayer; - public FPlayer getFPlayer() { return this.fplayer; } + private final UPlayer fplayer; + public UPlayer getFPlayer() { return this.fplayer; } private String newTitle; public String getNewTitle() { return this.newTitle; } @@ -30,7 +30,7 @@ public class FactionsEventTitleChange extends FactionsEventAbstractSender // CONSTRUCT // -------------------------------------------- // - public FactionsEventTitleChange(CommandSender sender, FPlayer fplayer, String newTitle) + public FactionsEventTitleChange(CommandSender sender, UPlayer fplayer, String newTitle) { super(sender); this.fplayer = fplayer; diff --git a/src/com/massivecraft/factions/integration/Econ.java b/src/com/massivecraft/factions/integration/Econ.java index 32b9eec0..1b12f8da 100644 --- a/src/com/massivecraft/factions/integration/Econ.java +++ b/src/com/massivecraft/factions/integration/Econ.java @@ -8,7 +8,7 @@ import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.EconomyParticipator; import com.massivecraft.factions.FPerm; import com.massivecraft.factions.Factions; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.util.RelationUtil; import com.massivecraft.mcore.money.Money; @@ -30,7 +30,7 @@ public class Econ // UTIL // -------------------------------------------- // - public static boolean payForAction(double cost, FPlayer fsender, String actionDescription) + public static boolean payForAction(double cost, UPlayer fsender, String actionDescription) { if (!isEnabled(fsender)) return true; if (cost == 0D) return true; @@ -64,7 +64,7 @@ public class Econ Money.add(universe, ConfServer.econUniverseAccount, delta); } - public static void sendBalanceInfo(FPlayer to, EconomyParticipator about) + public static void sendBalanceInfo(UPlayer to, EconomyParticipator about) { if (!isEnabled(to)) { @@ -84,7 +84,7 @@ public class Econ if (fI == null) return true; // Bypassing players can do any kind of transaction - if (i instanceof FPlayer && ((FPlayer)i).isUsingAdminMode()) return true; + if (i instanceof UPlayer && ((UPlayer)i).isUsingAdminMode()) return true; // You can deposit to anywhere you feel like. It's your loss if you can't withdraw it again. if (i == you) return true; @@ -167,21 +167,21 @@ public class Econ return false; } - public static Set getFplayers(EconomyParticipator ep) + public static Set getFplayers(EconomyParticipator ep) { - Set fplayers = new HashSet(); + Set fplayers = new HashSet(); if (ep == null) { // Add nothing } - else if (ep instanceof FPlayer) + else if (ep instanceof UPlayer) { - fplayers.add((FPlayer)ep); + fplayers.add((UPlayer)ep); } else if (ep instanceof Faction) { - fplayers.addAll(((Faction)ep).getFPlayers()); + fplayers.addAll(((Faction)ep).getUPlayers()); } return fplayers; @@ -189,35 +189,35 @@ public class Econ public static void sendTransferInfo(EconomyParticipator invoker, EconomyParticipator from, EconomyParticipator to, double amount) { - Set recipients = new HashSet(); + Set recipients = new HashSet(); recipients.addAll(getFplayers(invoker)); recipients.addAll(getFplayers(from)); recipients.addAll(getFplayers(to)); if (invoker == null) { - for (FPlayer recipient : recipients) + for (UPlayer recipient : recipients) { recipient.msg("%s was transfered from %s to %s.", Money.format(from, amount), from.describeTo(recipient), to.describeTo(recipient)); } } else if (invoker == from) { - for (FPlayer recipient : recipients) + for (UPlayer recipient : recipients) { recipient.msg("%s gave %s to %s.", from.describeTo(recipient, true), Money.format(from, amount), to.describeTo(recipient)); } } else if (invoker == to) { - for (FPlayer recipient : recipients) + for (UPlayer recipient : recipients) { recipient.msg("%s took %s from %s.", to.describeTo(recipient, true), Money.format(from, amount), from.describeTo(recipient)); } } else { - for (FPlayer recipient : recipients) + for (UPlayer recipient : recipients) { recipient.msg("%s transfered %s from %s to %s.", invoker.describeTo(recipient, true), Money.format(from, amount), from.describeTo(recipient), to.describeTo(recipient)); } diff --git a/src/com/massivecraft/factions/integration/LWCFeatures.java b/src/com/massivecraft/factions/integration/LWCFeatures.java index bcfa2e0c..3c67c560 100644 --- a/src/com/massivecraft/factions/integration/LWCFeatures.java +++ b/src/com/massivecraft/factions/integration/LWCFeatures.java @@ -14,7 +14,7 @@ import com.griefcraft.lwc.LWC; import com.griefcraft.lwc.LWCPlugin; import com.griefcraft.model.Protection; import com.massivecraft.factions.Factions; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.mcore.ps.PS; @@ -48,8 +48,8 @@ public class LWCFeatures { for (Protection protection : getProtectionsInChunk(chunkPs)) { - FPlayer owner = FPlayer.get(protection.getOwner()); - if (faction.getFPlayers().contains(owner)) continue; + UPlayer owner = UPlayer.get(protection.getOwner()); + if (faction.getUPlayers().contains(owner)) continue; protection.remove(); } } diff --git a/src/com/massivecraft/factions/integration/SpoutFeatures.java b/src/com/massivecraft/factions/integration/SpoutFeatures.java index d2aad973..e8103cae 100644 --- a/src/com/massivecraft/factions/integration/SpoutFeatures.java +++ b/src/com/massivecraft/factions/integration/SpoutFeatures.java @@ -12,7 +12,7 @@ import org.bukkit.ChatColor; import org.bukkit.plugin.Plugin; import org.bukkit.entity.Player; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.util.HealthBarUtil; import com.massivecraft.mcore.ps.PS; @@ -72,7 +72,7 @@ public class SpoutFeatures for (Player player : fromPlayers) { - FPlayer fplayer = FPlayer.get(player); + UPlayer fplayer = UPlayer.get(player); SpoutPlayer splayer = SpoutManager.getPlayer(player); Faction faction = fplayer.getFaction(); @@ -137,13 +137,13 @@ public class SpoutFeatures for (Player player : fromPlayers) { - FPlayer fplayer = FPlayer.get(player); + UPlayer fplayer = UPlayer.get(player); SpoutPlayer splayer = SpoutManager.getPlayer(player); Faction faction = fplayer.getFaction(); for (Player playerTo : toPlayers) { - FPlayer fplayerTo = FPlayer.get(playerTo); + UPlayer fplayerTo = UPlayer.get(playerTo); SpoutPlayer splayerTo = SpoutManager.getPlayer(playerTo); Faction factionTo = fplayerTo.getFaction(); @@ -178,7 +178,7 @@ public class SpoutFeatures }, 5); } - public static String generateTitle(Player player, FPlayer fplayer, Faction faction, ChatColor relationColor) + public static String generateTitle(Player player, UPlayer fplayer, Faction faction, ChatColor relationColor) { String ret = null; @@ -220,9 +220,9 @@ public class SpoutFeatures { ret.add((Player)o); } - else if (o instanceof FPlayer) + else if (o instanceof UPlayer) { - FPlayer fplayer = (FPlayer)o; + UPlayer fplayer = (UPlayer)o; Player player = fplayer.getPlayer(); if (player != null) { @@ -252,7 +252,7 @@ public class SpoutFeatures for (Player player : Bukkit.getOnlinePlayers()) { - FPlayer fplayer = FPlayer.get(player); + UPlayer fplayer = UPlayer.get(player); if (chunk == null) { mainListener.updateTerritoryDisplay(fplayer, false); @@ -265,7 +265,7 @@ public class SpoutFeatures } // update displayed current territory for specified player; returns false if unsuccessful - public static boolean updateTerritoryDisplay(FPlayer player) + public static boolean updateTerritoryDisplay(UPlayer player) { if ( ! isEnabled()) return false; return mainListener.updateTerritoryDisplay(player, true); @@ -280,7 +280,7 @@ public class SpoutFeatures for (Player player : Bukkit.getOnlinePlayers()) { - FPlayer fplayer = FPlayer.get(player); + UPlayer fplayer = UPlayer.get(player); if (chunk == null || fplayer.getCurrentChunk().equals(chunk)) { mainListener.updateAccessInfo(fplayer); @@ -289,13 +289,13 @@ public class SpoutFeatures } // update owner list for specified player - public static boolean updateAccessInfo(FPlayer player) + public static boolean updateAccessInfo(UPlayer player) { if ( ! isEnabled()) return false; return mainListener.updateAccessInfo(player); } - public static void playerDisconnect(FPlayer player) + public static void playerDisconnect(UPlayer player) { if ( ! isEnabled()) return; mainListener.removeTerritoryLabels(player.getName()); diff --git a/src/com/massivecraft/factions/integration/SpoutMainListener.java b/src/com/massivecraft/factions/integration/SpoutMainListener.java index 2c70783d..75a2f976 100644 --- a/src/com/massivecraft/factions/integration/SpoutMainListener.java +++ b/src/com/massivecraft/factions/integration/SpoutMainListener.java @@ -12,7 +12,7 @@ import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.Factions; import com.massivecraft.factions.TerritoryAccess; import com.massivecraft.factions.entity.BoardColls; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.mcore.ps.PS; @@ -28,7 +28,7 @@ public class SpoutMainListener implements Listener @EventHandler(priority = EventPriority.NORMAL) public void onSpoutCraftEnable(SpoutCraftEnableEvent event) { - final FPlayer me = FPlayer.get(event.getPlayer()); + final UPlayer me = UPlayer.get(event.getPlayer()); SpoutFeatures.updateTitle(me, null); SpoutFeatures.updateTitle(null, me); @@ -46,7 +46,7 @@ public class SpoutMainListener implements Listener // private final static int SCREEN_HEIGHT = 240; - public boolean updateTerritoryDisplay(FPlayer player, boolean notify) + public boolean updateTerritoryDisplay(UPlayer player, boolean notify) { Player p = player.getPlayer(); if (p == null) @@ -61,7 +61,7 @@ public class SpoutMainListener implements Listener return true; } - public boolean updateAccessInfo(FPlayer player) + public boolean updateAccessInfo(UPlayer player) { Player p = player.getPlayer(); if (p == null) @@ -86,7 +86,7 @@ public class SpoutMainListener implements Listener } - private void doLabels(FPlayer player, SpoutPlayer sPlayer, boolean notify) + private void doLabels(UPlayer player, SpoutPlayer sPlayer, boolean notify) { PS here = player.getCurrentChunk(); Faction factionHere = BoardColls.get().getFactionAt(here); @@ -159,7 +159,7 @@ public class SpoutMainListener implements Listener private static final Color accessGrantedColor = new Color(0.2f, 1.0f, 0.2f); private static final Color accessDeniedColor = new Color(1.0f, 0.2f, 0.2f); - private void doAccessInfo(FPlayer player, SpoutPlayer sPlayer, PS here) + private void doAccessInfo(UPlayer player, SpoutPlayer sPlayer, PS here) { if (ConfServer.spoutTerritoryDisplayPosition <= 0 || ConfServer.spoutTerritoryDisplaySize <= 0 || ! ConfServer.spoutTerritoryAccessShow) return; diff --git a/src/com/massivecraft/factions/integration/herochat/FactionsChannelAbstract.java b/src/com/massivecraft/factions/integration/herochat/FactionsChannelAbstract.java index f8cca6a3..d2592c21 100644 --- a/src/com/massivecraft/factions/integration/herochat/FactionsChannelAbstract.java +++ b/src/com/massivecraft/factions/integration/herochat/FactionsChannelAbstract.java @@ -23,7 +23,7 @@ import com.dthielke.herochat.MessageFormatSupplier; import com.dthielke.herochat.MessageNotFoundException; import com.dthielke.herochat.util.Messaging; import com.massivecraft.factions.Rel; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.Faction; public abstract class FactionsChannelAbstract implements Channel @@ -211,13 +211,13 @@ public abstract class FactionsChannelAbstract implements Channel { Set ret = new HashSet(); - FPlayer fpsender = FPlayer.get(sender); + UPlayer fpsender = UPlayer.get(sender); Faction faction = fpsender.getFaction(); String universe = fpsender.getUniverse(); for (Player player : Bukkit.getOnlinePlayers()) { - FPlayer frecipient = FPlayer.get(player); + UPlayer frecipient = UPlayer.get(player); if (!frecipient.getUniverse().equals(universe)) continue; if (!this.getTargetRelations().contains(faction.getRelationTo(frecipient))) continue; ret.add(player); diff --git a/src/com/massivecraft/factions/integration/herochat/HerochatEngine.java b/src/com/massivecraft/factions/integration/herochat/HerochatEngine.java index a0cc6190..54f4678e 100644 --- a/src/com/massivecraft/factions/integration/herochat/HerochatEngine.java +++ b/src/com/massivecraft/factions/integration/herochat/HerochatEngine.java @@ -10,7 +10,7 @@ import com.dthielke.herochat.ChannelChatEvent; import com.dthielke.herochat.Herochat; import com.massivecraft.factions.Factions; import com.massivecraft.factions.chat.ChatFormatter; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.MConf; @@ -54,7 +54,7 @@ public class HerochatEngine implements Listener String format = event.getFormat(); format = format.replaceAll("&r", "§r"); - format = ChatFormatter.format(format, FPlayer.get(event.getSender().getPlayer()), null); + format = ChatFormatter.format(format, UPlayer.get(event.getSender().getPlayer()), null); event.setFormat(format); } diff --git a/src/com/massivecraft/factions/listeners/FactionsListenerChat.java b/src/com/massivecraft/factions/listeners/FactionsListenerChat.java index 13a38e85..68a5c26b 100644 --- a/src/com/massivecraft/factions/listeners/FactionsListenerChat.java +++ b/src/com/massivecraft/factions/listeners/FactionsListenerChat.java @@ -8,7 +8,7 @@ import org.bukkit.event.player.AsyncPlayerChatEvent; import com.massivecraft.factions.Factions; import com.massivecraft.factions.chat.ChatFormatter; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.MConf; public class FactionsListenerChat implements Listener @@ -96,7 +96,7 @@ public class FactionsListenerChat implements Listener // ... then parse tags a.k.a. "format the format". String format = event.getFormat(); - format = ChatFormatter.format(format, FPlayer.get(event.getPlayer()), null); + format = ChatFormatter.format(format, UPlayer.get(event.getPlayer()), null); event.setFormat(format); } diff --git a/src/com/massivecraft/factions/listeners/FactionsListenerMain.java b/src/com/massivecraft/factions/listeners/FactionsListenerMain.java index 4724cc89..0b1507da 100644 --- a/src/com/massivecraft/factions/listeners/FactionsListenerMain.java +++ b/src/com/massivecraft/factions/listeners/FactionsListenerMain.java @@ -50,7 +50,7 @@ import com.massivecraft.factions.FPerm; import com.massivecraft.factions.Factions; import com.massivecraft.factions.Rel; import com.massivecraft.factions.entity.BoardColls; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.entity.UConf; @@ -89,7 +89,7 @@ public class FactionsListenerMain implements Listener { // If a player dies ... Player player = event.getEntity(); - FPlayer fplayer = FPlayer.get(player); + UPlayer fplayer = UPlayer.get(player); // ... and powerloss can happen here ... Faction faction = BoardColls.get().getFactionAt(PS.valueOf(player)); @@ -169,7 +169,7 @@ public class FactionsListenerMain implements Listener Entity edefender = event.getEntity(); if (!(edefender instanceof Player)) return true; Player defender = (Player)edefender; - FPlayer fdefender = FPlayer.get(edefender); + UPlayer fdefender = UPlayer.get(edefender); // ... and the attacker is someone else ... Entity eattacker = event.getDamager(); @@ -190,7 +190,7 @@ public class FactionsListenerMain implements Listener { if (notify) { - FPlayer attacker = FPlayer.get(eattacker); + UPlayer attacker = UPlayer.get(eattacker); attacker.msg("PVP is disabled in %s.", defenderPsFaction.describeTo(attacker)); } return false; @@ -201,7 +201,7 @@ public class FactionsListenerMain implements Listener // ... and if the attacker is a player ... if (!(eattacker instanceof Player)) return true; Player attacker = (Player)eattacker; - FPlayer fattacker = FPlayer.get(attacker); + UPlayer fattacker = UPlayer.get(attacker); // ... does this player bypass all protection? ... if (MConf.get().playersWhoBypassAllProtection.contains(attacker.getName())) return true; @@ -292,7 +292,7 @@ public class FactionsListenerMain implements Listener { // If a player was kicked from the server ... Player player = event.getPlayer(); - FPlayer fplayer = FPlayer.get(player); + UPlayer fplayer = UPlayer.get(player); // ... and if the if player was banned (not just kicked) ... if (!event.getReason().equals("Banned by admin.")) return; @@ -331,7 +331,7 @@ public class FactionsListenerMain implements Listener { // If a player is trying to run a command ... Player player = event.getPlayer(); - FPlayer fplayer = FPlayer.get(player); + UPlayer fplayer = UPlayer.get(player); // ... and the player does not have adminmode ... if (fplayer.isUsingAdminMode()) return; @@ -508,7 +508,7 @@ public class FactionsListenerMain implements Listener String name = player.getName(); if (MConf.get().playersWhoBypassAllProtection.contains(name)) return true; - FPlayer me = FPlayer.get(player); + UPlayer me = UPlayer.get(player); if (me.isUsingAdminMode()) return true; Faction factionHere = BoardColls.get().getFactionAt(ps); diff --git a/src/com/massivecraft/factions/listeners/TodoFactionsPlayerListener.java b/src/com/massivecraft/factions/listeners/TodoFactionsPlayerListener.java index a8313f37..a86791a3 100644 --- a/src/com/massivecraft/factions/listeners/TodoFactionsPlayerListener.java +++ b/src/com/massivecraft/factions/listeners/TodoFactionsPlayerListener.java @@ -17,7 +17,7 @@ import com.massivecraft.factions.Const; import com.massivecraft.factions.FPerm; import com.massivecraft.factions.TerritoryAccess; import com.massivecraft.factions.entity.BoardColls; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.MConf; import com.massivecraft.factions.integration.SpoutFeatures; import com.massivecraft.mcore.event.MCorePlayerLeaveEvent; @@ -32,7 +32,7 @@ public class TodoFactionsPlayerListener implements Listener { // If a player is joining the server ... Player player = event.getPlayer(); - FPlayer fplayer = FPlayer.get(player); + UPlayer fplayer = UPlayer.get(player); // ... recalculate their power as if they were offline since last recalculation ... fplayer.recalculatePower(false); @@ -51,7 +51,7 @@ public class TodoFactionsPlayerListener implements Listener public void onPlayerLeave(MCorePlayerLeaveEvent event) { Player player = event.getPlayer(); - FPlayer fplayer = FPlayer.get(player); + UPlayer fplayer = 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. @@ -69,7 +69,7 @@ public class TodoFactionsPlayerListener implements Listener // ... update the stored current chunk ... Player player = event.getPlayer(); - FPlayer fplayer = FPlayer.get(player); + UPlayer fplayer = UPlayer.get(player); PS chunkFrom = fplayer.getCurrentChunk(); PS chunkTo = PS.valueOf(event.getTo()).getChunk(true); @@ -145,7 +145,7 @@ public class TodoFactionsPlayerListener implements Listener String name = player.getName(); if (MConf.get().playersWhoBypassAllProtection.contains(name)) return true; - FPlayer fplayer = FPlayer.get(player); + UPlayer fplayer = UPlayer.get(player); if (fplayer.isUsingAdminMode()) return true; return FPerm.BUILD.has(fplayer, ps, !justCheck); @@ -156,7 +156,7 @@ public class TodoFactionsPlayerListener implements Listener String name = player.getName(); if (MConf.get().playersWhoBypassAllProtection.contains(name)) return true; - FPlayer me = FPlayer.get(player); + UPlayer me = UPlayer.get(player); if (me.isUsingAdminMode()) return true; PS ps = PS.valueOf(block); diff --git a/src/com/massivecraft/factions/task/AutoLeaveTask.java b/src/com/massivecraft/factions/task/AutoLeaveTask.java index 7127d16d..944e29bf 100644 --- a/src/com/massivecraft/factions/task/AutoLeaveTask.java +++ b/src/com/massivecraft/factions/task/AutoLeaveTask.java @@ -1,8 +1,8 @@ package com.massivecraft.factions.task; import com.massivecraft.factions.ConfServer; -import com.massivecraft.factions.entity.FPlayerColl; -import com.massivecraft.factions.entity.FPlayerColls; +import com.massivecraft.factions.entity.UPlayerColl; +import com.massivecraft.factions.entity.UPlayerColls; import com.massivecraft.mcore.ModuloRepeatTask; import com.massivecraft.mcore.util.TimeUnit; @@ -34,7 +34,7 @@ public class AutoLeaveTask extends ModuloRepeatTask @Override public void invoke() { - for (FPlayerColl coll : FPlayerColls.get().getColls()) + for (UPlayerColl coll : UPlayerColls.get().getColls()) { coll.autoLeaveOnInactivityRoutine(); } diff --git a/src/com/massivecraft/factions/util/RelationUtil.java b/src/com/massivecraft/factions/util/RelationUtil.java index d9a1deec..ac72eb1f 100644 --- a/src/com/massivecraft/factions/util/RelationUtil.java +++ b/src/com/massivecraft/factions/util/RelationUtil.java @@ -5,7 +5,7 @@ import org.bukkit.ChatColor; import com.massivecraft.factions.FFlag; import com.massivecraft.factions.Rel; import com.massivecraft.factions.RelationParticipator; -import com.massivecraft.factions.entity.FPlayer; +import com.massivecraft.factions.entity.UPlayer; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MConf; import com.massivecraft.mcore.util.Txt; @@ -29,7 +29,7 @@ public class RelationUtil if (that instanceof Faction) { - if (me instanceof FPlayer && myFaction == thatFaction) + if (me instanceof UPlayer && myFaction == thatFaction) { ret = "your faction"; } @@ -38,9 +38,9 @@ public class RelationUtil ret = thatFaction.getTag(); } } - else if (that instanceof FPlayer) + else if (that instanceof UPlayer) { - FPlayer fplayerthat = (FPlayer) that; + UPlayer fplayerthat = (UPlayer) that; if (that == me) { ret = "you"; @@ -98,9 +98,9 @@ public class RelationUtil ret = Rel.MEMBER; // Do officer and leader check //P.p.log("getRelationOfThatToMe the factions are the same for "+that.getClass().getSimpleName()+" and observer "+me.getClass().getSimpleName()); - if (that instanceof FPlayer) + if (that instanceof UPlayer) { - ret = ((FPlayer)that).getRole(); + ret = ((UPlayer)that).getRole(); //P.p.log("getRelationOfThatToMe it was a player and role is "+ret); } } @@ -119,9 +119,9 @@ public class RelationUtil return (Faction) rp; } - if (rp instanceof FPlayer) + if (rp instanceof UPlayer) { - return ((FPlayer) rp).getFaction(); + return ((UPlayer) rp).getFaction(); } // ERROR