From 7c491b7bc7344da33c47b23088de2b2a3d0a67ca Mon Sep 17 00:00:00 2001 From: Dinnerbone Date: Fri, 2 Sep 2011 20:46:26 +0100 Subject: [PATCH] Fixed world.save, implemented autosave methods --- .../java/org/bukkit/craftbukkit/CraftWorld.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 23d45a6df7..0faf610eb1 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -567,11 +567,20 @@ public class CraftWorld implements World { } public void save() { - // Writes level.dat - world.saveLevel(); + boolean oldSave = world.canSave; - // Saves all chunks/regions - world.chunkProvider.saveChunks(true, null); + world.canSave = false; + world.save(true, null); + + world.canSave = oldSave; + } + + public boolean isAutoSave() { + return !world.canSave; + } + + public void setAutoSave(boolean value) { + world.canSave = !value; } public boolean hasStorm() {