2018-01-18 14:00:51 +08:00
|
|
|
From 65ca23df75fa2cb76fcb5bd81019d04fe882701a Mon Sep 17 00:00:00 2001
|
2016-05-08 11:39:22 +08: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
|
2018-01-18 14:00:51 +08:00
|
|
|
index 430b5d0cd..011cbf5e3 100644
|
2016-05-08 11:39:22 +08:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
2017-05-05 07:08:52 +08:00
|
|
|
@@ -225,4 +225,9 @@ public class PaperConfig {
|
2016-05-08 11:39:22 +08: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
|
2018-01-18 14:00:51 +08:00
|
|
|
index c9c01fad9..89c8d045b 100644
|
2016-05-08 11:39:22 +08:00
|
|
|
--- a/src/main/java/net/minecraft/server/PersistentScoreboard.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PersistentScoreboard.java
|
2016-05-12 10:07:46 +08:00
|
|
|
@@ -184,6 +184,7 @@ public class PersistentScoreboard extends PersistentBase {
|
2016-05-08 11:39:22 +08:00
|
|
|
|
|
|
|
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());
|
|
|
|
--
|
2018-01-18 14:00:51 +08:00
|
|
|
2.16.1
|
2016-05-08 11:39:22 +08:00
|
|
|
|