From bc0a8da76f329823df2d6a4df8b4b3f074143f1e Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Thu, 18 Apr 2013 12:29:56 +0200 Subject: [PATCH] Remove LazyLocation and declare that Tasks are not Utils. --- src/com/massivecraft/factions/ConfServer.java | 4 +- src/com/massivecraft/factions/Factions.java | 4 +- .../factions/cmd/CmdFactionsClaim.java | 2 +- .../{util => task}/AutoLeaveTask.java | 2 +- .../{util => task}/EconLandRewardTask.java | 2 +- .../factions/{util => task}/SpiralTask.java | 2 +- .../factions/util/LazyLocation.java | 107 ------------------ 7 files changed, 8 insertions(+), 115 deletions(-) rename src/com/massivecraft/factions/{util => task}/AutoLeaveTask.java (93%) rename src/com/massivecraft/factions/{util => task}/EconLandRewardTask.java (95%) rename src/com/massivecraft/factions/{util => task}/SpiralTask.java (99%) delete mode 100644 src/com/massivecraft/factions/util/LazyLocation.java diff --git a/src/com/massivecraft/factions/ConfServer.java b/src/com/massivecraft/factions/ConfServer.java index 13e4e664..2f00afdd 100644 --- a/src/com/massivecraft/factions/ConfServer.java +++ b/src/com/massivecraft/factions/ConfServer.java @@ -53,9 +53,9 @@ public class ConfServer extends SimpleConfig public static double powerPerHourOffline = 0.0; // players will no longer lose power from being offline once their power drops to this amount or less - public static double powerLimitGainOnline = 0.0; + public static double powerLimitGainOnline = 10.0; public static double powerLimitGainOffline = 0.0; - public static double powerLimitLossOnline = 0.0; + public static double powerLimitLossOnline = -10.0; public static double powerLimitLossOffline = 0.0; public static boolean scaleNegativePower = false; // Power regeneration rate increase as power decreases diff --git a/src/com/massivecraft/factions/Factions.java b/src/com/massivecraft/factions/Factions.java index ab83cc1f..253f78b0 100644 --- a/src/com/massivecraft/factions/Factions.java +++ b/src/com/massivecraft/factions/Factions.java @@ -16,8 +16,8 @@ import com.massivecraft.factions.listeners.FactionsChatListener; import com.massivecraft.factions.listeners.FactionsEntityListener; import com.massivecraft.factions.listeners.FactionsExploitListener; import com.massivecraft.factions.listeners.FactionsPlayerListener; -import com.massivecraft.factions.util.AutoLeaveTask; -import com.massivecraft.factions.util.EconLandRewardTask; +import com.massivecraft.factions.task.AutoLeaveTask; +import com.massivecraft.factions.task.EconLandRewardTask; import com.massivecraft.mcore.MPlugin; import com.massivecraft.mcore.xlib.gson.GsonBuilder; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsClaim.java b/src/com/massivecraft/factions/cmd/CmdFactionsClaim.java index ad8fa7ef..716dd59e 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsClaim.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsClaim.java @@ -4,7 +4,7 @@ import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.Faction; import com.massivecraft.factions.Perm; import com.massivecraft.factions.cmd.arg.ARFaction; -import com.massivecraft.factions.util.SpiralTask; +import com.massivecraft.factions.task.SpiralTask; import com.massivecraft.mcore.cmd.arg.ARInteger; import com.massivecraft.mcore.cmd.req.ReqHasPerm; import com.massivecraft.mcore.cmd.req.ReqIsPlayer; diff --git a/src/com/massivecraft/factions/util/AutoLeaveTask.java b/src/com/massivecraft/factions/task/AutoLeaveTask.java similarity index 93% rename from src/com/massivecraft/factions/util/AutoLeaveTask.java rename to src/com/massivecraft/factions/task/AutoLeaveTask.java index 8c095b6a..044f7f84 100644 --- a/src/com/massivecraft/factions/util/AutoLeaveTask.java +++ b/src/com/massivecraft/factions/task/AutoLeaveTask.java @@ -1,4 +1,4 @@ -package com.massivecraft.factions.util; +package com.massivecraft.factions.task; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FPlayerColl; diff --git a/src/com/massivecraft/factions/util/EconLandRewardTask.java b/src/com/massivecraft/factions/task/EconLandRewardTask.java similarity index 95% rename from src/com/massivecraft/factions/util/EconLandRewardTask.java rename to src/com/massivecraft/factions/task/EconLandRewardTask.java index 39beaf5f..a236bfa1 100644 --- a/src/com/massivecraft/factions/util/EconLandRewardTask.java +++ b/src/com/massivecraft/factions/task/EconLandRewardTask.java @@ -1,4 +1,4 @@ -package com.massivecraft.factions.util; +package com.massivecraft.factions.task; import com.massivecraft.factions.ConfServer; import com.massivecraft.factions.FactionColl; diff --git a/src/com/massivecraft/factions/util/SpiralTask.java b/src/com/massivecraft/factions/task/SpiralTask.java similarity index 99% rename from src/com/massivecraft/factions/util/SpiralTask.java rename to src/com/massivecraft/factions/task/SpiralTask.java index 8c20e325..a5dcbcc2 100644 --- a/src/com/massivecraft/factions/util/SpiralTask.java +++ b/src/com/massivecraft/factions/task/SpiralTask.java @@ -1,4 +1,4 @@ -package com.massivecraft.factions.util; +package com.massivecraft.factions.task; import java.util.logging.Level; diff --git a/src/com/massivecraft/factions/util/LazyLocation.java b/src/com/massivecraft/factions/util/LazyLocation.java deleted file mode 100644 index 83d748ac..00000000 --- a/src/com/massivecraft/factions/util/LazyLocation.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.massivecraft.factions.util; - -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.World; - -/* - * This class provides a lazy-load Location, so that World doesn't need to be initialized - * yet when an object of this class is created, only when the Location is first accessed. - */ - -public class LazyLocation -{ - private Location location = null; - private String worldName; - private double x; - private double y; - private double z; - private float pitch; - private float yaw; - - public LazyLocation(Location loc) - { - setLocation(loc); - } - - public LazyLocation(final String worldName, final double x, final double y, final double z) - { - this(worldName, x, y, z, 0, 0); - } - - public LazyLocation(final String worldName, final double x, final double y, final double z, final float yaw, final float pitch) - { - this.worldName = worldName; - this.x = x; - this.y = y; - this.z = z; - this.yaw = yaw; - this.pitch = pitch; - } - - // This returns the actual Location - public final Location getLocation() - { - // make sure Location is initialized before returning it - initLocation(); - return location; - } - - // change the Location - public final void setLocation(Location loc) - { - this.location = loc; - this.worldName = loc.getWorld().getName(); - this.x = loc.getX(); - this.y = loc.getY(); - this.z = loc.getZ(); - this.yaw = loc.getYaw(); - this.pitch = loc.getPitch(); - } - - - // This initializes the Location - private void initLocation() - { - // if location is already initialized, simply return - if (location != null) return; - - // get World; hopefully it's initialized at this point - World world = Bukkit.getWorld(worldName); - if (world == null) return; - - // store the Location for future calls, and pass it on - location = new Location(world, x, y, z, yaw, pitch); - } - - - public final String getWorldName() - { - return worldName; - } - - public final double getX() - { - return x; - } - - public final double getY() - { - return y; - } - - public final double getZ() - { - return z; - } - - public final double getPitch() - { - return pitch; - } - - public final double getYaw() - { - return yaw; - } -}