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/0560-Dont-write-unwritable-json-files-paper.patch
2021-04-14 17:34:29 +02:00

23 Zeilen
984 B
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zeanon <thezeanon@gmail.com>
Date: Wed, 14 Apr 2021 16:18:13 +0200
Subject: [PATCH] Dont write unwritable json files paper
diff --git a/src/main/java/net/minecraft/server/JsonList.java b/src/main/java/net/minecraft/server/JsonList.java
index c97be42dd7b4c6ea2cadcc97f47185c7f02e2cce..3298ed8dcf5e86afefcb9d55447cff7435eaaee7 100644
--- a/src/main/java/net/minecraft/server/JsonList.java
+++ b/src/main/java/net/minecraft/server/JsonList.java
@@ -168,6 +168,11 @@ public class JsonList<K, V extends JsonListEntry<K>> {
}
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);