aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0130-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch
blob: 5386a8201030a45f7f9eb28da6d00e92938793c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 0886e9d5e5edb0b883647a0ac6b83aa38b602b29 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 710c432d8..e009e5cf2 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -230,4 +230,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 230004b4a..62752f816 100644
--- a/src/main/java/net/minecraft/server/PersistentScoreboard.java
+++ b/src/main/java/net/minecraft/server/PersistentScoreboard.java
@@ -184,6 +184,7 @@ public class PersistentScoreboard extends PersistentBase {
 
         while (iterator.hasNext()) {
             ScoreboardTeam scoreboardteam = (ScoreboardTeam) iterator.next();
+            if (!com.destroystokyo.paper.PaperConfig.saveEmptyScoreboardTeams && scoreboardteam.getPlayerNameSet().isEmpty()) continue; // Paper
             NBTTagCompound nbttagcompound = new NBTTagCompound();
 
             nbttagcompound.setString("Name", scoreboardteam.getName());
-- 
2.12.2.windows.2