diff options
author | feildmaster <admin@feildmaster.com> | 2012-12-21 15:21:34 -0600 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-12-21 15:40:39 -0600 |
commit | 118682ce5cd8492ecc554c1356567d7b6628c01e (patch) | |
tree | acce3dfb8346f86aa4d07e39871d8653f2cde4be /src/main/java/net/minecraft/server | |
parent | 0216d09033f11f664402331798988de56321a38b (diff) | |
download | craftbukkit-118682ce5cd8492ecc554c1356567d7b6628c01e.tar craftbukkit-118682ce5cd8492ecc554c1356567d7b6628c01e.tar.gz craftbukkit-118682ce5cd8492ecc554c1356567d7b6628c01e.tar.lz craftbukkit-118682ce5cd8492ecc554c1356567d7b6628c01e.tar.xz craftbukkit-118682ce5cd8492ecc554c1356567d7b6628c01e.zip |
Don't save server properties when it's read only. Fixes BUKKIT-3250
Diffstat (limited to 'src/main/java/net/minecraft/server')
-rw-r--r-- | src/main/java/net/minecraft/server/PropertyManager.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/PropertyManager.java b/src/main/java/net/minecraft/server/PropertyManager.java index 30c4dcf8..cc5ddc71 100644 --- a/src/main/java/net/minecraft/server/PropertyManager.java +++ b/src/main/java/net/minecraft/server/PropertyManager.java @@ -69,6 +69,11 @@ public class PropertyManager { FileOutputStream fileoutputstream = null; try { + // CraftBukkit start - Don't attempt writing to file if it's read only + if (!this.c.canWrite()) { + return; + } + // CraftBukkit end fileoutputstream = new FileOutputStream(this.c); this.properties.store(fileoutputstream, "Minecraft server properties"); } catch (Exception exception) { |