3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 12:30:06 +01:00
Paper/patches/server/0101-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
2024-04-24 03:25:14 +02:00
index 4a01558a1c3d9cfcd043ad3998514311fe8f63d9..b679bbdfa307d3aa9f2f5e4c70c559695b2733de 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
2024-04-24 03:25:14 +02:00
@@ -148,6 +148,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
for (PlayerTeam playerTeam : this.scoreboard.getPlayerTeams()) {
+ if (!io.papermc.paper.configuration.GlobalConfiguration.get().scoreboards.saveEmptyScoreboardTeams && playerTeam.getPlayers().isEmpty()) continue; // Paper - Don't save empty scoreboard teams to scoreboard.dat
2021-06-12 07:20:08 +02:00
CompoundTag compoundTag = new CompoundTag();
compoundTag.putString("Name", playerTeam.getName());
2024-04-24 03:25:14 +02:00
compoundTag.putString("DisplayName", Component.Serializer.toJson(playerTeam.getDisplayName(), registries));