geforkt von Mirrors/Paper
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.
Dieser Commit ist enthalten in:
Ursprung
e7be15b884
Commit
68f8205a32
@ -0,0 +1,33 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 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 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());
|
||||||
|
--
|
@ -59,6 +59,7 @@ import FileIOThread
|
|||||||
import ItemBlock
|
import ItemBlock
|
||||||
import NBTTagCompound
|
import NBTTagCompound
|
||||||
import NBTTagList
|
import NBTTagList
|
||||||
|
import PersistentScoreboard
|
||||||
import PacketPlayInResourcePackStatus
|
import PacketPlayInResourcePackStatus
|
||||||
import PacketPlayInUseEntity
|
import PacketPlayInUseEntity
|
||||||
import PacketPlayOutPlayerListHeaderFooter
|
import PacketPlayOutPlayerListHeaderFooter
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren