Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-22 14:28:09 +01:00
c99e4a22aa
I need more creative commit messages.
40 Zeilen
2.0 KiB
Diff
40 Zeilen
2.0 KiB
Diff
From f10e8a5ef24dc16f21bcd5dd130133f2e67d5cca 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
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
index ec89ecfca..b602bbf12 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
@@ -282,4 +282,13 @@ public class PaperConfig {
|
|
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
|
|
index a562e1e46..cbfdb3cf7 100644
|
|
--- a/src/main/java/net/minecraft/server/WorldNBTStorage.java
|
|
+++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java
|
|
@@ -144,6 +144,7 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData {
|
|
}
|
|
|
|
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());
|
|
File file = new File(this.playerDir, entityhuman.bu() + ".dat.tmp");
|
|
--
|
|
2.18.0
|
|
|