summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java27
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandworld.java24
2 files changed, 39 insertions, 12 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
index 25bc02871..ead427b82 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
@@ -68,12 +68,29 @@ public class EssentialsPlayerListener extends PlayerListener
final World world = worlds.get(user.getWorld() == worlds.get(0) ? 1 : 0);
double factor;
- if (user.getWorld().getEnvironment() == World.Environment.NETHER && world.getEnvironment() == World.Environment.NORMAL)
- factor = 16.0;
- else if (user.getWorld().getEnvironment() != world.getEnvironment())
- factor = 1.0 / 16.0;
- else
+ if (user.getWorld().getEnvironment() == World.Environment.NETHER && world.getEnvironment() == World.Environment.NORMAL) {
+ if (Essentials.getSettings().use1to1RatioInNether())
+ {
+ factor = 1.0;
+ }
+ else
+ {
+ factor = 16.0;
+ }
+ }
+ else if (user.getWorld().getEnvironment() != world.getEnvironment()) {
+ if (Essentials.getSettings().use1to1RatioInNether())
+ {
+ factor = 1.0;
+ }
+ else
+ {
+ factor = 1.0 / 16.0;
+ }
+ }
+ else {
factor = 1.0;
+ }
int x = loc.getBlockX();
int y = loc.getBlockY();
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandworld.java b/Essentials/src/com/earth2me/essentials/commands/Commandworld.java
index 93e452fd3..f430b0904 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandworld.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandworld.java
@@ -50,19 +50,29 @@ public class Commandworld extends EssentialsCommand
}
double factor;
- if (user.getWorld().getEnvironment() == World.Environment.NETHER && world.getEnvironment() == World.Environment.NORMAL)
+ if (user.getWorld().getEnvironment() == World.Environment.NETHER && world.getEnvironment() == World.Environment.NORMAL) {
if (Essentials.getSettings().use1to1RatioInNether())
{
- factor = 1;
+ factor = 1.0;
}
else
{
- factor = 16;
+ factor = 16.0;
}
- else if (user.getWorld().getEnvironment() != world.getEnvironment())
- factor = 1 / 16;
- else
- factor = 1;
+ }
+ else if (user.getWorld().getEnvironment() != world.getEnvironment()) {
+ if (Essentials.getSettings().use1to1RatioInNether())
+ {
+ factor = 1.0;
+ }
+ else
+ {
+ factor = 1.0 / 16.0;
+ }
+ }
+ else {
+ factor = 1.0;
+ }
Location loc = user.getLocation();
loc = new Location(world, loc.getBlockX() * factor + .5, loc.getBlockY(), loc.getBlockZ() * factor + .5);