From ca376a12251e0399ab59d38e745b747710634bbf Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Mon, 7 Feb 2011 01:59:06 +0000 Subject: [PATCH] I'm quite aware that I fail at merging. By: Dinnerbone --- .../java/org/bukkit/craftbukkit/CraftServer.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java index c84c5da0f1..4c4ee29f4f 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -11,6 +11,7 @@ import net.minecraft.server.EntityPlayer; import net.minecraft.server.MinecraftServer; import net.minecraft.server.PropertyManager; import net.minecraft.server.ServerConfigurationManager; +import net.minecraft.server.WorldManager; import net.minecraft.server.WorldServer; import org.bukkit.*; import org.bukkit.plugin.Plugin; @@ -153,8 +154,16 @@ public final class CraftServer implements Server { return scheduler; } - public World[] getWorlds() { - return console.worlds.toArray(new World[0]); + public List getWorlds() { + List worlds = new ArrayList(); + + synchronized (console.worlds) { + for (WorldServer world : console.worlds) { + worlds.add(world.getWorld()); + } + } + + return worlds; } public ServerConfigurationManager getHandle() {