3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 12:30:06 +01:00
Paper/patches/server/0095-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-12-05 20:54:55 +01:00
index 28e631be85fb06245e152e1f5e0bae16b7358cfd..b49d60d20d170d16a7daf2bc874e5d8d04552b3e 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-12-05 20:54:55 +01: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
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()));