mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 17:01:56 +01:00
Allow Disabling Player Data Saving
By: Sander Knauff <sanderknauff@hotmail.com>
This commit is contained in:
parent
76c24a1454
commit
e81bcdf643
2 changed files with 15 additions and 2 deletions
|
@ -11,7 +11,15 @@
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
public class PlayerDataStorage {
|
public class PlayerDataStorage {
|
||||||
@@ -49,34 +51,55 @@
|
@@ -33,6 +35,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
public void save(Player player) {
|
||||||
|
+ if (org.spigotmc.SpigotConfig.disablePlayerDataSaving) return; // Spigot
|
||||||
|
try {
|
||||||
|
CompoundTag nbttagcompound = player.saveWithoutId(new CompoundTag());
|
||||||
|
Path path = this.playerDir.toPath();
|
||||||
|
@@ -49,34 +52,55 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +86,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,20 +107,44 @@
|
@@ -84,20 +108,44 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<CompoundTag> load(Player player) {
|
public Optional<CompoundTag> load(Player player) {
|
||||||
|
|
|
@ -396,4 +396,9 @@ public class SpigotConfig
|
||||||
SpigotConfig.logVillagerDeaths = SpigotConfig.getBoolean("settings.log-villager-deaths", true);
|
SpigotConfig.logVillagerDeaths = SpigotConfig.getBoolean("settings.log-villager-deaths", true);
|
||||||
SpigotConfig.logNamedDeaths = SpigotConfig.getBoolean("settings.log-named-deaths", true);
|
SpigotConfig.logNamedDeaths = SpigotConfig.getBoolean("settings.log-named-deaths", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean disablePlayerDataSaving;
|
||||||
|
private static void disablePlayerDataSaving() {
|
||||||
|
SpigotConfig.disablePlayerDataSaving = SpigotConfig.getBoolean("players.disable-saving", false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue