PaperMC/patches/server/0093-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch

19 lines
1.2 KiB
Diff
Raw Permalink Normal View History

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-10-22 20:04:31 +02:00
index 8b7a84ff5ecac694166c96c2d2592b6073a0cfc0..618bbdfbb0f790ee9c55a8f720436c22dbc9775a 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));