2018-09-28 23:31:59 +00:00
|
|
|
From 3037a0a752877e38b6b03ab95371a177ce898e4e Mon Sep 17 00:00:00 2001
|
2016-12-21 18:41:30 +00:00
|
|
|
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
|
2018-09-28 23:31:59 +00:00
|
|
|
index ec2f0d269b..a848edfc10 100644
|
2016-12-21 18:41:30 +00:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
2018-09-28 23:31:59 +00:00
|
|
|
@@ -266,4 +266,13 @@ public class PaperConfig {
|
2018-03-05 01:20:27 +00:00
|
|
|
maxPlayerAutoSavePerTick = (playerAutoSaveRate == -1 || playerAutoSaveRate > 100) ? 10 : 20;
|
|
|
|
}
|
2016-12-21 18:41:30 +00:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public static boolean removeInvalidStatistics = false;
|
|
|
|
+ private static void removeInvalidStatistics() {
|
2016-12-28 01:23:18 +00:00
|
|
|
+ if (version < 12) {
|
|
|
|
+ boolean oldValue = getBoolean("remove-invalid-statistics", false);
|
|
|
|
+ set("settings.remove-invalid-statistics", oldValue);
|
|
|
|
+ }
|
|
|
|
+ removeInvalidStatistics = getBoolean("settings.remove-invalid-statistics", false);
|
2016-12-21 18:41:30 +00:00
|
|
|
+ }
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/ServerStatisticManager.java b/src/main/java/net/minecraft/server/ServerStatisticManager.java
|
2018-08-26 18:11:49 +00:00
|
|
|
index 6405f98e06..42e2f3d22b 100644
|
2016-12-21 18:41:30 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/ServerStatisticManager.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ServerStatisticManager.java
|
2018-07-17 20:32:05 +00:00
|
|
|
@@ -83,6 +83,7 @@ public class ServerStatisticManager extends StatisticManager {
|
|
|
|
try {
|
|
|
|
JsonReader jsonreader = new JsonReader(new StringReader(s));
|
|
|
|
Throwable throwable = null;
|
2016-12-21 18:41:30 +00:00
|
|
|
+ java.util.List<String> invalidStats = com.google.common.collect.Lists.newArrayList(); // Paper
|
|
|
|
|
2018-07-17 20:32:05 +00:00
|
|
|
try {
|
|
|
|
jsonreader.setLenient(false);
|
2018-08-26 18:11:49 +00:00
|
|
|
@@ -120,6 +121,7 @@ public class ServerStatisticManager extends StatisticManager {
|
2016-12-21 18:41:30 +00:00
|
|
|
|
2018-08-26 18:11:49 +00:00
|
|
|
if (statistic == null) {
|
|
|
|
ServerStatisticManager.b.warn("Invalid statistic in {}: Don\'t know what {} is", this.d, s2);
|
2018-07-17 20:32:05 +00:00
|
|
|
+ if (com.destroystokyo.paper.PaperConfig.removeInvalidStatistics) invalidStats.add(s2); // Paper
|
2018-08-26 18:11:49 +00:00
|
|
|
} else {
|
|
|
|
this.a.put(statistic, nbttagcompound2.getInt(s2));
|
|
|
|
}
|
2016-12-21 18:41:30 +00:00
|
|
|
--
|
2018-09-26 04:57:59 +00:00
|
|
|
2.19.0
|
2016-12-21 18:41:30 +00:00
|
|
|
|