Paper/patches/server/0096-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch

19 Zeilen
1.2 KiB
Diff

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 7 May 2016 23:33:08 -0400
Subject: [PATCH] Don't save empty scoreboard teams to scoreboard.dat
diff --git a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
2023-09-22 19:31:02 +02:00
index 1ad11be7652c1d26557f52fdc784c6e5db350a0c..5e83991c7f89ec3ea2d76e299536e959eff3a20a 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
+++ b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
2023-09-21 22:14:58 +02:00
@@ -143,6 +143,7 @@ public class ScoreboardSaveData extends SavedData {
2021-06-12 07:20:08 +02:00
ListTag listTag = new ListTag();
2021-06-11 14:02:28 +02:00
2021-06-12 07:20:08 +02:00
for(PlayerTeam playerTeam : this.scoreboard.getPlayerTeams()) {
+ if (!io.papermc.paper.configuration.GlobalConfiguration.get().scoreboards.saveEmptyScoreboardTeams && playerTeam.getPlayers().isEmpty()) continue; // Paper
2021-06-12 07:20:08 +02:00
CompoundTag compoundTag = new CompoundTag();
compoundTag.putString("Name", playerTeam.getName());
compoundTag.putString("DisplayName", Component.Serializer.toJson(playerTeam.getDisplayName()));