Paper/Spigot-Server-Patches/0203-Make-player-data-saving-configurable.patch
Riley Park 4e958e229f
We're going on an Adventure! (#4842)
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: zml <zml@stellardrift.ca>
Co-authored-by: Mariell Hoversholm <proximyst@proximyst.com>
2021-02-21 20:45:33 +01:00

28 lines
1.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mark Vainomaa <mikroskeem@mikroskeem.eu>
Date: Mon, 26 Mar 2018 18:30:53 +0300
Subject: [PATCH] Make player data saving configurable
Upstream has added a patch which negates the need for this patch,
however, we should still migrate our configuration back upstream,
to prevent unexpected situations
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index cedc8c45224fe991a2ec8dd2ed435edadd556be9..701d84adb75cc3b2ca4d7ee16481e8687fa45cd5 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -274,4 +274,13 @@ public class PaperConfig {
private static void authenticationServersDownKickMessage() {
authenticationServersDownKickMessage = Strings.emptyToNull(getString("messages.kick.authentication-servers-down", authenticationServersDownKickMessage));
}
+
+ private static void savePlayerData() {
+ Object val = config.get("settings.save-player-data");
+ if (val instanceof Boolean) {
+ SpigotConfig.disablePlayerDataSaving = !(Boolean) val;
+ SpigotConfig.config.set("players.disable-saving", SpigotConfig.disableAdvancementSaving);
+ SpigotConfig.save();
+ }
+ }
}