summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDinnerbone <dinnerbone@dinnerbone.com>2011-02-07 01:59:06 +0000
committerDinnerbone <dinnerbone@dinnerbone.com>2011-02-07 01:59:06 +0000
commit172db788b329857b2ae4f771b3da9aa454ea548f (patch)
treec250e0a4286d55b2f2749da590a51f4dd9de4617
parent919023fe5da4e60ba708c692f9d12d337dc98b0f (diff)
downloadcraftbukkit-172db788b329857b2ae4f771b3da9aa454ea548f.tar
craftbukkit-172db788b329857b2ae4f771b3da9aa454ea548f.tar.gz
craftbukkit-172db788b329857b2ae4f771b3da9aa454ea548f.tar.lz
craftbukkit-172db788b329857b2ae4f771b3da9aa454ea548f.tar.xz
craftbukkit-172db788b329857b2ae4f771b3da9aa454ea548f.zip
I'm quite aware that I fail at merging.
-rw-r--r--src/main/java/net/minecraft/server/MinecraftServer.java9
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftServer.java13
2 files changed, 14 insertions, 8 deletions
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 716f3a73..23ef042b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -293,6 +293,8 @@ public class MinecraftServer implements ICommandListener, Runnable {
entityplayer.a.b((Packet) (new Packet4UpdateTime(entityplayer.world.e)));
}
}
+
+ ((CraftScheduler) server.getScheduler()).mainThreadHeartbeat(this.h);
for (WorldServer world : worlds) {
world.f();
@@ -300,12 +302,7 @@ public class MinecraftServer implements ICommandListener, Runnable {
while (world.d()) {
;
}
-
- ;
- ((CraftScheduler) server.getScheduler()).mainThreadHeartbeat(this.h);
-
- while (this.e.d()) {
- ;
+
world.c();
}
// Craftbukkit end
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index c84c5da0..4c4ee29f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/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<World> getWorlds() {
+ List<World> worlds = new ArrayList<World>();
+
+ synchronized (console.worlds) {
+ for (WorldServer world : console.worlds) {
+ worlds.add(world.getWorld());
+ }
+ }
+
+ return worlds;
}
public ServerConfigurationManager getHandle() {