Archiviert
13
0
Dieses Repository wurde am 2021-12-14 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
SteamSpigot/Paper/SteamWar-Patches/Dont_write_unwritable_json_files_paper.patch
2021-04-13 20:03:49 +02:00

21 Zeilen
917 B
Diff

Index: src/main/java/net/minecraft/server/JsonList.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/main/java/net/minecraft/server/JsonList.java b/src/main/java/net/minecraft/server/JsonList.java
--- a/src/main/java/net/minecraft/server/JsonList.java (revision 403d1f3f73eeb2b64054992d57aaacd68d0b4547)
+++ b/src/main/java/net/minecraft/server/JsonList.java (date 1618244429374)
@@ -168,6 +168,11 @@
}
public void save() throws IOException {
+ //Steamwar Start
+ if (!this.c.canWrite()) {
+ return;
+ }
+ //Steamwar End Don't write to unwriteable files
this.removeStaleEntries(); // Paper - remove expired values before saving
Collection<V> collection = this.d.values();
String s = this.b.toJson(collection);