mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-03 15:08:18 +01:00
Use the correct nether in case there are more worlds loaded.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1251 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
parent
f4a15da12b
commit
755938ca5f
@ -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) {
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user