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 47f77ad8ef4e9a26c6a4bbc8a73b9943f7604a6a..8cece23c90e1fc78415f2f743fc9a91b15670d75 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -242,4 +242,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/world/scores/ScoreboardSaveData.java b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java index 90a97a87fe67d8c3bbc60f08c9911faa4259349e..2153e7035535990b5307b85d8bc3dab50c0a3ae8 100644 --- a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java +++ b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java @@ -144,6 +144,7 @@ public class ScoreboardSaveData extends SavedData { ListTag listTag = new ListTag(); for(PlayerTeam playerTeam : this.scoreboard.getPlayerTeams()) { + if (!com.destroystokyo.paper.PaperConfig.saveEmptyScoreboardTeams && playerTeam.getPlayers().isEmpty()) continue; // Paper CompoundTag compoundTag = new CompoundTag(); compoundTag.putString("Name", playerTeam.getName()); compoundTag.putString("DisplayName", Component.Serializer.toJson(playerTeam.getDisplayName()));