2018-09-01 00:56:57 +02:00
|
|
|
From e55c4df2d0b9ab32522e632bb4db0b35066f3f70 Mon Sep 17 00:00:00 2001
|
2016-05-08 05:39:22 +02:00
|
|
|
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
|
2018-08-06 01:46:43 +02:00
|
|
|
index 9fe1311143..a1110da38e 100644
|
2016-05-08 05:39:22 +02:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
2018-07-24 02:24:44 +02:00
|
|
|
@@ -229,4 +229,9 @@ public class PaperConfig {
|
2016-05-08 05:39:22 +02:00
|
|
|
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
|
2018-09-01 00:56:57 +02:00
|
|
|
index f2e8eface3..895ea0eb41 100644
|
2016-05-08 05:39:22 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/PersistentScoreboard.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PersistentScoreboard.java
|
2018-09-01 00:56:57 +02:00
|
|
|
@@ -160,6 +160,7 @@ public class PersistentScoreboard extends PersistentBase {
|
|
|
|
NBTTagList nbttaglist = new NBTTagList();
|
2016-05-08 05:39:22 +02:00
|
|
|
|
2018-09-01 00:56:57 +02:00
|
|
|
for(ScoreboardTeam scoreboardteam : this.b.getTeams()) {
|
2016-05-08 05:39:22 +02:00
|
|
|
+ if (!com.destroystokyo.paper.PaperConfig.saveEmptyScoreboardTeams && scoreboardteam.getPlayerNameSet().isEmpty()) continue; // Paper
|
|
|
|
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
|
|
|
nbttagcompound.setString("Name", scoreboardteam.getName());
|
2018-09-01 00:56:57 +02:00
|
|
|
nbttagcompound.setString("DisplayName", IChatBaseComponent.ChatSerializer.a(scoreboardteam.getDisplayName()));
|
2016-05-08 05:39:22 +02:00
|
|
|
--
|
2018-07-19 06:42:43 +02:00
|
|
|
2.18.0
|
2016-05-08 05:39:22 +02:00
|
|
|
|