From 68f8205a32acdfb1b7c1a018a890b5983d7c0371 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 | 33 +++++++++++++++++++ scripts/importmcdev.sh | 1 + 2 files changed, 34 insertions(+) create mode 100644 Spigot-Server-Patches/Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch diff --git a/Spigot-Server-Patches/Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch b/Spigot-Server-Patches/Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch new file mode 100644 index 0000000000..2bbd65e3f0 --- /dev/null +++ b/Spigot-Server-Patches/Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch @@ -0,0 +1,33 @@ +From 0000000000000000000000000000000000000000 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/PersistentScoreboard.java ++++ b/src/main/java/net/minecraft/server/PersistentScoreboard.java +@@ -0,0 +0,0 @@ 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()); +-- \ No newline at end of file diff --git a/scripts/importmcdev.sh b/scripts/importmcdev.sh index 091fff948e..b3d688f5d0 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