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

23 Zeilen
984 B
Diff

2021-04-14 17:34:29 +02:00
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
2020-12-26 23:49:53 +01:00
diff --git a/src/main/java/net/minecraft/server/JsonList.java b/src/main/java/net/minecraft/server/JsonList.java
2021-04-14 17:34:29 +02:00
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>> {
2020-12-26 23:49:53 +01:00
}
public void save() throws IOException {
2021-04-12 19:54:42 +02:00
+ //Steamwar Start
2021-04-13 20:03:49 +02:00
+ if (!this.c.canWrite()) {
2020-12-26 23:49:53 +01:00
+ return;
2021-04-12 19:54:42 +02:00
+ }
+ //Steamwar End Don't write to unwriteable files
this.removeStaleEntries(); // Paper - remove expired values before saving
2020-12-26 23:49:53 +01:00
Collection<V> collection = this.d.values();
String s = this.b.toJson(collection);