From c10df228a7f552b90b667c9c3472753ce6c036e5 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 7 May 2016 23:39:22 -0400 Subject: [PATCH] Don't save empty scoreboard teams to scoreboard.dat - Fixes #244 While I can't think of any reason to do this except some REALLY weird workflow, I still added a config to let you save them incase someone runs into issues. --- ...y-scoreboard-teams-to-scoreboard.dat.patch | 35 +++++++++++++++++++ scripts/importmcdev.sh | 1 + 2 files changed, 36 insertions(+) create mode 100644 Spigot-Server-Patches/0156-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch diff --git a/Spigot-Server-Patches/0156-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch b/Spigot-Server-Patches/0156-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch new file mode 100644 index 000000000..71ada08a1 --- /dev/null +++ b/Spigot-Server-Patches/0156-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch @@ -0,0 +1,35 @@ +From 6b473248bd86bc52923944193dab9587e0a49959 Mon Sep 17 00:00:00 2001 +From: Aikar +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 1199fa2..f5f1e2a 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +@@ -223,4 +223,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 3ef20d3..db72494 100644 +--- a/src/main/java/net/minecraft/server/PersistentScoreboard.java ++++ b/src/main/java/net/minecraft/server/PersistentScoreboard.java +@@ -182,6 +182,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.8.2 + diff --git a/scripts/importmcdev.sh b/scripts/importmcdev.sh index 091fff948..b3d688f5d 100755 --- a/scripts/importmcdev.sh +++ b/scripts/importmcdev.sh @@ -59,6 +59,7 @@ import FileIOThread import ItemBlock import NBTTagCompound import NBTTagList +import PersistentScoreboard import PacketPlayInResourcePackStatus import PacketPlayInUseEntity import PacketPlayOutPlayerListHeaderFooter