2020-01-22 03:02:07 +01:00
|
|
|
From 5f5a1708e434f8f6483ec908c404f2dd456f0d69 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
|
2019-12-12 00:43:22 +01:00
|
|
|
index e4f0db64c..67f35fe66 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
|
2019-05-06 09:20:16 +02:00
|
|
|
@@ -228,4 +228,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
|
2019-12-12 00:43:22 +01:00
|
|
|
index 1eab0c310..6bf66972f 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
|
2019-04-27 05:05:36 +02:00
|
|
|
@@ -174,6 +174,7 @@ public class PersistentScoreboard extends PersistentBase {
|
2016-05-08 05:39:22 +02:00
|
|
|
|
2019-01-01 04:15:55 +01:00
|
|
|
while (iterator.hasNext()) {
|
|
|
|
ScoreboardTeam scoreboardteam = (ScoreboardTeam) iterator.next();
|
2016-05-08 05:39:22 +02:00
|
|
|
+ if (!com.destroystokyo.paper.PaperConfig.saveEmptyScoreboardTeams && scoreboardteam.getPlayerNameSet().isEmpty()) continue; // Paper
|
|
|
|
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
2019-01-01 04:15:55 +01:00
|
|
|
|
2016-05-08 05:39:22 +02:00
|
|
|
nbttagcompound.setString("Name", scoreboardteam.getName());
|
|
|
|
--
|
2020-01-22 03:02:07 +01:00
|
|
|
2.25.0.windows.1
|
2016-05-08 05:39:22 +02:00
|
|
|
|