From 6846c426c4d2d45d46790d728cdddbf18d631957 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Wed, 24 Apr 2013 14:31:10 +0200 Subject: [PATCH] Minor touches to player defaults. --- src/com/massivecraft/factions/Factions.java | 5 +- .../factions/chat/tag/ChatTagTitle.java | 1 + .../massivecraft/factions/entity/UConf.java | 57 ++++++++----------- .../massivecraft/factions/entity/UPlayer.java | 9 +-- 4 files changed, 30 insertions(+), 42 deletions(-) diff --git a/src/com/massivecraft/factions/Factions.java b/src/com/massivecraft/factions/Factions.java index cd3bd989..12c1eba5 100644 --- a/src/com/massivecraft/factions/Factions.java +++ b/src/com/massivecraft/factions/Factions.java @@ -104,16 +104,13 @@ public class Factions extends MPlugin // TODO: Perhaps this should be placed in the econ integration somewhere? MUtil.registerExtractor(String.class, "accountId", ExtractorFactionAccountId.get()); - // Initialize Collections + // Initialize Database this.databaseInitialized = false; - MConfColl.get().init(); UPlayerColls.get().init(); FactionColls.get().init(); BoardColls.get().init(); - FactionColls.get().reindexUPlayers(); - this.databaseInitialized = true; // Commands diff --git a/src/com/massivecraft/factions/chat/tag/ChatTagTitle.java b/src/com/massivecraft/factions/chat/tag/ChatTagTitle.java index a2bde9b9..06a5cde6 100644 --- a/src/com/massivecraft/factions/chat/tag/ChatTagTitle.java +++ b/src/com/massivecraft/factions/chat/tag/ChatTagTitle.java @@ -20,6 +20,7 @@ public class ChatTagTitle extends ChatTagAbstract @Override public String getReplacement(UPlayer fsender, UPlayer frecipient) { + if (!fsender.hasTitle()) return ""; return fsender.getTitle(); } diff --git a/src/com/massivecraft/factions/entity/UConf.java b/src/com/massivecraft/factions/entity/UConf.java index adbf673e..efe45645 100644 --- a/src/com/massivecraft/factions/entity/UConf.java +++ b/src/com/massivecraft/factions/entity/UConf.java @@ -36,13 +36,24 @@ public class UConf extends Entity // DEFAULTS // -------------------------------------------- // - public String defaultPlayerFactionId = this.factionIdNone; - public double defaultPlayerPower = 0.0; + public String defaultPlayerFactionId = factionIdNone; public Rel defaultPlayerRole = Rel.RECRUIT; + public double defaultPlayerPower = 0.0; public boolean defaultFactionOpen = false; public Map defaultFactionFlags = FFlag.getDefaultDefaults(); public Map> defaultFactionPerms = FPerm.getDefaultDefaults(); + + // -------------------------------------------- // + // POWER + // -------------------------------------------- // + + public double powerMax = 10.0; + public double powerMin = 0.0; + public double powerPerHour = 2.0; + public double powerPerDeath = -2.0; + + public boolean canLeaveWithNegativePower = true; // -------------------------------------------- // // CORE @@ -55,32 +66,6 @@ public class UConf extends Entity public int factionTagLengthMax = 10; public boolean factionTagForceUpperCase = false; - // -------------------------------------------- // - // ASSORTED - // -------------------------------------------- // - - public boolean permanentFactionsDisableLeaderPromotion = false; - - public int actionDeniedPainAmount = 2; - - public boolean disablePVPForFactionlessPlayers = false; - public boolean enablePVPAgainstFactionlessInAttackersLand = false; - - public double territoryShieldFactor = 0.3; - - - - // -------------------------------------------- // - // POWER - // -------------------------------------------- // - - public double powerMax = 10.0; - public double powerMin = 0.0; - public double powerPerHour = 2.0; - public double powerPerDeath = -2.0; - - public boolean canLeaveWithNegativePower = true; - // -------------------------------------------- // // CLAIMS // -------------------------------------------- // @@ -106,6 +91,16 @@ public class UConf extends Entity public double homesTeleportAllowedEnemyDistance = 32.0; public boolean homesTeleportIgnoreEnemiesIfInOwnTerritory = true; + // -------------------------------------------- // + // ASSORTED + // -------------------------------------------- // + + public boolean permanentFactionsDisableLeaderPromotion = false; + public int actionDeniedPainAmount = 2; + public boolean disablePVPForFactionlessPlayers = false; + public boolean enablePVPAgainstFactionlessInAttackersLand = false; + public double territoryShieldFactor = 0.3; + // -------------------------------------------- // // DENY COMMANDS // -------------------------------------------- // @@ -121,12 +116,6 @@ public class UConf extends Entity Rel.ALLY, new ArrayList(), Rel.MEMBER, new ArrayList() ); - - // -------------------------------------------- // - // INTEGRATION: WORLD GUARD - // -------------------------------------------- // - - public boolean worldGuardChecking = false; // -------------------------------------------- // // INTEGRATION: LWC diff --git a/src/com/massivecraft/factions/entity/UPlayer.java b/src/com/massivecraft/factions/entity/UPlayer.java index ad58da03..076a7f03 100644 --- a/src/com/massivecraft/factions/entity/UPlayer.java +++ b/src/com/massivecraft/factions/entity/UPlayer.java @@ -69,27 +69,28 @@ public class UPlayer extends SenderEntity implements EconomyParticipato // This is a foreign key. // Each player belong to a faction. - // Null means default which is the no-faction faction called Wilderness. + // Null means default for the universe. private String factionId = null; // What role does the player have in the faction? - // Null means default which is the default value for the universe. + // Null means default for the universe. private Rel role = null; // What title does the player have in the faction? // The title is just for fun. It's not connected to any game mechanic. - // The default case is no title since it's what you start with and also the most common case. // The player title is similar to the faction description. // // Question: Can the title contain chat colors? // Answer: Yes but in such case the policy is that they already must be parsed using Txt.parse. // If the title contains raw markup, such as "" instead of "§f" it will not be parsed and "" will be displayed. + // + // Null means the player has no title. private String title = null; // Each player has an individual power level. // The power level for online players is occasionally updated by a recurring task and the power should stay the same for offline players. // For that reason the value is to be considered correct when you pick it. Do not call the power update method. - // Null means default which is the default value for the universe. + // Null means default for the universe. private Double power = null; // -------------------------------------------- //