Paper/Spigot-Server-Patches/0159-Add-option-to-remove-invalid-statistics.patch
Aikar 835bc39b03
Paper 1.13.1 Update
Updated Upstream (Bukkit/CraftBukkit/Spigot)

Bukkit Changes:
2dcc44dc SPIGOT-4307: Fix hacky API for banners on shields
e0fc6572 SPIGOT-4309: Add "forced" display of particles
efeeab2f Add index to README.md for easier navigation
f502bc6f Update to Minecraft 1.13.1

CraftBukkit Changes:
d0bb0a1d Fix some tests randomly failing
997d378d Fix client stall in specific teleportation scenarios
b3dc2366 SPIGOT-4307: Fix hacky API for banners on shields
2a271162 SPIGOT-4301: Fix more invalid enchants
5d0d83bb SPIGOT-4309: Add "forced" display of particles
a6772578 Add additional tests for CraftBlockData
ce1af0c3 Update to Minecraft 1.13.1

Spigot Changes:
2440e189 Rebuild patches
4ecffced Update to Minecraft 1.13.1
2018-08-26 20:51:39 -04:00

48 lines
2.4 KiB
Diff

From 835919765540d8cdbaca376e1f1ad2e8e23e868e Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Tue, 20 Dec 2016 23:09:21 -0600
Subject: [PATCH] Add option to remove invalid statistics
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index c1845d6811..9f1182c723 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -266,4 +266,13 @@ public class PaperConfig {
maxPlayerAutoSavePerTick = (playerAutoSaveRate == -1 || playerAutoSaveRate > 100) ? 10 : 20;
}
}
+
+ public static boolean removeInvalidStatistics = false;
+ private static void removeInvalidStatistics() {
+ if (version < 12) {
+ boolean oldValue = getBoolean("remove-invalid-statistics", false);
+ set("settings.remove-invalid-statistics", oldValue);
+ }
+ removeInvalidStatistics = getBoolean("settings.remove-invalid-statistics", false);
+ }
}
diff --git a/src/main/java/net/minecraft/server/ServerStatisticManager.java b/src/main/java/net/minecraft/server/ServerStatisticManager.java
index 6405f98e06..42e2f3d22b 100644
--- a/src/main/java/net/minecraft/server/ServerStatisticManager.java
+++ b/src/main/java/net/minecraft/server/ServerStatisticManager.java
@@ -83,6 +83,7 @@ public class ServerStatisticManager extends StatisticManager {
try {
JsonReader jsonreader = new JsonReader(new StringReader(s));
Throwable throwable = null;
+ java.util.List<String> invalidStats = com.google.common.collect.Lists.newArrayList(); // Paper
try {
jsonreader.setLenient(false);
@@ -120,6 +121,7 @@ public class ServerStatisticManager extends StatisticManager {
if (statistic == null) {
ServerStatisticManager.b.warn("Invalid statistic in {}: Don\'t know what {} is", this.d, s2);
+ if (com.destroystokyo.paper.PaperConfig.removeInvalidStatistics) invalidStats.add(s2); // Paper
} else {
this.a.put(statistic, nbttagcompound2.getInt(s2));
}
--
2.18.0