From 9a264ed666902c1790287d7659b1f4a0e47f696e Mon Sep 17 00:00:00 2001 From: Morgan Humes Date: Fri, 25 Feb 2011 21:29:42 -0500 Subject: [PATCH] Implements World.save and Server.savePlayers() --- src/main/java/net/minecraft/server/World.java | 2 +- src/main/java/org/bukkit/craftbukkit/CraftServer.java | 6 +++++- src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 8 ++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java index c990a9d64d..66938f6a96 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -42,7 +42,7 @@ public class World implements IBlockAccess { public boolean l = false; public final WorldProvider m; protected List n = new ArrayList(); - protected IChunkProvider o; + public IChunkProvider o; // CraftBukkit protected->public protected final IDataManager p; public WorldData q; // CraftBukkit protected->public public boolean r; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 703a1fc425..367cff0156 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -262,7 +262,7 @@ public final class CraftServer implements Server { } } } - + return new CraftWorld(internal); } @@ -297,4 +297,8 @@ public final class CraftServer implements Server { return null; } } + + public void savePlayers() { + server.d(); + } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index b0f088b647..e740dea7bf 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -474,4 +474,12 @@ public class CraftWorld implements World { return list; } + + public void save() { + // Writes level.dat + world.r(); + + // Saves all chunks/regions + world.o.a(true, null); + } }