mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-18 00:25:39 +01:00
18c3716c49
This enables us a fast reference to the entities current chunk instead of having to look it up by hashmap lookups. We also store counts by type to further enable other performance optimizations in later patches.
36 lines
1.7 KiB
Diff
36 lines
1.7 KiB
Diff
From 046d1dbd3f9ea1948d7d1c66e188f5d1f142b382 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 430b5d0cd..011cbf5e3 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
@@ -225,4 +225,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 c9c01fad9..89c8d045b 100644
|
|
--- a/src/main/java/net/minecraft/server/PersistentScoreboard.java
|
|
+++ b/src/main/java/net/minecraft/server/PersistentScoreboard.java
|
|
@@ -184,6 +184,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.18.0
|
|
|