2019-03-20 02:46:00 +01:00
|
|
|
From d58753f3ebf083c564382b1300d98339a9b1db78 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
|
2019-03-20 02:46:00 +01:00
|
|
|
index 68c287026..3d924fd80 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
|
2018-12-15 02:17:27 +01:00
|
|
|
@@ -291,4 +291,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
|
2019-03-20 02:46:00 +01:00
|
|
|
index c4173c0aa..d5e21cc33 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
|
2018-08-26 20:11:49 +02:00
|
|
|
@@ -141,6 +141,7 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData {
|
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());
|
2018-07-18 20:55:52 +02:00
|
|
|
File file = new File(this.playerDir, entityhuman.bu() + ".dat.tmp");
|
2018-03-27 16:45:54 +02:00
|
|
|
--
|
2019-03-20 02:46:00 +01:00
|
|
|
2.21.0
|
2018-03-27 16:45:54 +02:00
|
|
|
|