Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-27 16:40:07 +01:00
49052de5e5
Fixes #1539 Fixes #1483
36 Zeilen
1.8 KiB
Diff
36 Zeilen
1.8 KiB
Diff
From 2d545f8fa238dff23b600d2668147533f6bd57e3 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/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
index 7ebab47835..a266328daf 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
@@ -232,4 +232,9 @@ public class PaperConfig {
|
|
private static void enablePlayerCollisions() {
|
|
enablePlayerCollisions = getBoolean("settings.enable-player-collisions", true);
|
|
}
|
|
+
|
|
+ public static boolean saveEmptyScoreboardTeams = false;
|
|
+ private static void saveEmptyScoreboardTeams() {
|
|
+ saveEmptyScoreboardTeams = getBoolean("settings.save-empty-scoreboard-teams", false);
|
|
+ }
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/PersistentScoreboard.java b/src/main/java/net/minecraft/server/PersistentScoreboard.java
|
|
index f2e8eface3..895ea0eb41 100644
|
|
--- a/src/main/java/net/minecraft/server/PersistentScoreboard.java
|
|
+++ b/src/main/java/net/minecraft/server/PersistentScoreboard.java
|
|
@@ -160,6 +160,7 @@ public class PersistentScoreboard extends PersistentBase {
|
|
NBTTagList nbttaglist = new NBTTagList();
|
|
|
|
for(ScoreboardTeam scoreboardteam : this.b.getTeams()) {
|
|
+ if (!com.destroystokyo.paper.PaperConfig.saveEmptyScoreboardTeams && scoreboardteam.getPlayerNameSet().isEmpty()) continue; // Paper
|
|
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
|
nbttagcompound.setString("Name", scoreboardteam.getName());
|
|
nbttagcompound.setString("DisplayName", IChatBaseComponent.ChatSerializer.a(scoreboardteam.getDisplayName()));
|
|
--
|
|
2.19.0
|
|
|