diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index a111a610c..d6a21d4ce 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -65,7 +65,20 @@ public class EssentialsPlayerListener extends PlayerListener if (user.getJustPortaled()) return; Location loc = event.getTo(); - final World world = worlds.get(user.getWorld() == worlds.get(0) ? 1 : 0); + World nether = server.getWorld(Essentials.getSettings().getNetherName()); + if (nether == null) { + for (World world : worlds) + { + if (world.getEnvironment() == World.Environment.NETHER) { + nether = world; + break; + } + } + if (nether == null) { + return; + } + } + final World world = user.getWorld() == nether ? worlds.get(0) : nether; double factor; if (user.getWorld().getEnvironment() == World.Environment.NETHER && world.getEnvironment() == World.Environment.NORMAL) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandworld.java b/Essentials/src/com/earth2me/essentials/commands/Commandworld.java index f430b0904..31826a0aa 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandworld.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandworld.java @@ -23,7 +23,20 @@ public class Commandworld extends EssentialsCommand if (args.length < 1) { - world = worlds.get(user.getWorld() == worlds.get(0) && worlds.size() > 1 ? 1 : 0); + World nether = server.getWorld(Essentials.getSettings().getNetherName()); + if (nether == null) { + for (World world2 : worlds) + { + if (world2.getEnvironment() == World.Environment.NETHER) { + nether = world2; + break; + } + } + if (nether == null) { + return; + } + } + world = user.getWorld() == nether ? worlds.get(0) : nether; } else {