0
0
mirror of https://hub.spigotmc.org/stash/scm/spigot/spigot.git synced 2024-11-21 20:56:14 +00:00
spigot/CraftBukkit-Patches/0073-Allow-Disabling-Player-Data-Saving.patch
2024-10-23 02:15:00 +11:00

36 lines
1.5 KiB
Diff

From 8f9bf322c879be6ab7c70f59af1f9c27da808c17 Mon Sep 17 00:00:00 2001
From: Sander Knauff <sanderknauff@hotmail.com>
Date: Sat, 7 Nov 2020 18:23:42 +1100
Subject: [PATCH] Allow Disabling Player Data Saving
diff --git a/src/main/java/net/minecraft/world/level/storage/WorldNBTStorage.java b/src/main/java/net/minecraft/world/level/storage/WorldNBTStorage.java
index c79f0fbd91..274fdb3644 100644
--- a/src/main/java/net/minecraft/world/level/storage/WorldNBTStorage.java
+++ b/src/main/java/net/minecraft/world/level/storage/WorldNBTStorage.java
@@ -35,6 +35,7 @@ public class WorldNBTStorage {
}
public void save(EntityHuman entityhuman) {
+ if (org.spigotmc.SpigotConfig.disablePlayerDataSaving) return; // Spigot
try {
NBTTagCompound nbttagcompound = entityhuman.saveWithoutId(new NBTTagCompound());
Path path = this.playerDir.toPath();
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
index 6502572f51..5e7ec99192 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
@@ -396,4 +396,9 @@ public class SpigotConfig
logVillagerDeaths = getBoolean("settings.log-villager-deaths", true);
logNamedDeaths = getBoolean("settings.log-named-deaths", true);
}
+
+ public static boolean disablePlayerDataSaving;
+ private static void disablePlayerDataSaving() {
+ disablePlayerDataSaving = getBoolean("players.disable-saving", false);
+ }
}
--
2.47.0