From bbc7c484081122506884ecbcb76f1f7066de8c09 Mon Sep 17 00:00:00 2001 From: Brettflan Date: Sun, 18 Dec 2011 03:05:22 -0600 Subject: [PATCH] Added 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 | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/massivecraft/factions/Conf.java b/src/com/massivecraft/factions/Conf.java index 46f563b8..1af2afd3 100644 --- a/src/com/massivecraft/factions/Conf.java +++ b/src/com/massivecraft/factions/Conf.java @@ -32,6 +32,7 @@ public class Conf // Power public static double powerPlayerMax = 10.0; public static double powerPlayerMin = -10.0; + public static double powerPlayerStarting = 0.0; // New players start out with this power level 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 scaleNegativePower = false; // Power regeneration rate increase as power decreases diff --git a/src/com/massivecraft/factions/FPlayer.java b/src/com/massivecraft/factions/FPlayer.java index 18e8ec0e..272415be 100644 --- a/src/com/massivecraft/factions/FPlayer.java +++ b/src/com/massivecraft/factions/FPlayer.java @@ -115,7 +115,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; @@ -653,7 +653,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator public boolean shouldBeSaved() { if (this.hasFaction()) return true; - if (this.getPowerRounded() != this.getPowerMaxRounded()) return true; + if (this.getPowerRounded() != this.getPowerMaxRounded() && this.getPowerRounded() != (int) Math.round(Conf.powerPlayerStarting)) return true; return false; }