From e32660c18889707b8e1fa606f4ac0e113593016b Mon Sep 17 00:00:00 2001 From: Brettflan Date: Sun, 18 Dec 2011 07:26:10 -0600 Subject: [PATCH] New conf.json setting "powerPlayerStarting" (default 0.0) for the power level which new players will now start at; previously new players would start with max power, now it's configurable --- src/com/massivecraft/factions/Conf.java | 1 + src/com/massivecraft/factions/FPlayer.java | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/com/massivecraft/factions/Conf.java b/src/com/massivecraft/factions/Conf.java index 5ada25b9..29aa4249 100644 --- a/src/com/massivecraft/factions/Conf.java +++ b/src/com/massivecraft/factions/Conf.java @@ -23,6 +23,7 @@ public class Conf // Power public static double powerPlayerMax = 10.0; public static double powerPlayerMin = -10.0; + public static double powerPlayerStarting = 0.0; public static double powerPerMinute = 0.2; // Default health rate... it takes 5 min to heal one power public static double powerPerDeath = 4.0; // A death makes you lose 4 power public static boolean powerRegenOffline = false; // does player power regenerate even while they're offline? diff --git a/src/com/massivecraft/factions/FPlayer.java b/src/com/massivecraft/factions/FPlayer.java index 6a0c24e3..0b6081ae 100644 --- a/src/com/massivecraft/factions/FPlayer.java +++ b/src/com/massivecraft/factions/FPlayer.java @@ -149,7 +149,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator public FPlayer() { this.resetFactionData(false); - this.power = this.getPowerMax(); + this.power = Conf.powerPlayerStarting; this.lastPowerUpdateTime = System.currentTimeMillis(); this.lastLoginTime = System.currentTimeMillis(); this.mapAutoUpdating = false; @@ -809,7 +809,10 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator @Override public boolean shouldBeSaved() { - if (this.getPowerRounded() == this.getPowerMaxRounded() && !this.hasFaction()) return false; + if (!this.hasFaction() && + (this.getPowerRounded() == this.getPowerMaxRounded() || this.getPowerRounded() == (int) Math.round(Conf.powerPlayerStarting)) + ) + return false; return ! this.deleteMe; }