Fixed a bunch of multiworld issues (entity tracking etc)

This commit is contained in:
Dinnerbone
2011-05-26 22:15:27 +01:00
parent 036f49ddbf
commit 1784e42d5f
5 changed files with 37 additions and 17 deletions

View File

@@ -51,7 +51,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
// CraftBukkit start
public int spawnProtection;
public List<WorldServer> worlds = new ArrayList<WorldServer>(); // TODO - REPLACE ABOVE
public List<WorldServer> worlds = new ArrayList<WorldServer>();
public CraftServer server;
public OptionSet options;
public ColouredConsoleSender console;
@@ -461,7 +461,15 @@ public class MinecraftServer implements Runnable, ICommandListener {
}
public WorldServer a(int i) {
return i == -1 ? this.worlds.get(1) : this.worlds.get(0); // Craftbukkit
// Craftbukkit start
for (WorldServer world : worlds) {
if (world.dimension == i) {
return world;
}
}
return worlds.get(0);
// Craftbukkit end
}
public EntityTracker b(int i) {