2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-03-27 16:45:54 +02:00
|
|
|
From: Mark Vainomaa <mikroskeem@mikroskeem.eu>
|
|
|
|
Date: Mon, 26 Mar 2018 18:30:53 +0300
|
|
|
|
Subject: [PATCH] Make player data saving configurable
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
2020-06-26 08:29:44 +02:00
|
|
|
index cee8740e644c492e3d71fd58791e7d52d57e856d..f22bed69f690f6e4754b87dd61cebe9c6627b12d 100644
|
2018-03-27 16:45:54 +02:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
2020-06-26 08:29:44 +02:00
|
|
|
@@ -271,4 +271,13 @@ public class PaperConfig {
|
2018-03-27 16:45:54 +02:00
|
|
|
private static void authenticationServersDownKickMessage() {
|
|
|
|
authenticationServersDownKickMessage = Strings.emptyToNull(getString("messages.kick.authentication-servers-down", authenticationServersDownKickMessage));
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public static boolean savePlayerData = true;
|
|
|
|
+ private static void savePlayerData() {
|
|
|
|
+ savePlayerData = getBoolean("settings.save-player-data", savePlayerData);
|
|
|
|
+ if(!savePlayerData) {
|
|
|
|
+ Bukkit.getLogger().log(Level.WARNING, "Player Data Saving is currently disabled. Any changes to your players data, " +
|
|
|
|
+ "such as inventories, experience points, advancements and the like will not be saved when they log out.");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java
|
2020-08-25 04:22:08 +02:00
|
|
|
index 9d81bb896e3688c644edf93cd9dfeadd9cdf8836..af9e94a87a946a4a9e2579a87f3f5a7adeb66f25 100644
|
2018-03-27 16:45:54 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/WorldNBTStorage.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java
|
2020-08-25 04:22:08 +02:00
|
|
|
@@ -25,6 +25,7 @@ public class WorldNBTStorage {
|
2020-06-25 16:09:55 +02:00
|
|
|
}
|
2018-03-27 16:45:54 +02:00
|
|
|
|
|
|
|
public void save(EntityHuman entityhuman) {
|
|
|
|
+ if(!com.destroystokyo.paper.PaperConfig.savePlayerData) return; // Paper - Make player data saving configurable
|
|
|
|
try {
|
|
|
|
NBTTagCompound nbttagcompound = entityhuman.save(new NBTTagCompound());
|
2020-06-25 16:09:55 +02:00
|
|
|
File file = File.createTempFile(entityhuman.getUniqueIDString() + "-", ".dat", this.playerDir);
|