mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-25 00:30:25 +01:00
b62dfa0bf9
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 39ce5d3a SPIGOT-4399: ItemMeta.equals broken with AttributeModifiers CraftBukkit Changes:1cf8b5dc
SPIGOT-4400: Populators running on existing chunks116cb9a1
SPIGOT-4399: Add attribute modifier equality test5ee1c18a
SPIGOT-4398: Set ASM7_EXPERIMENTAL flag
47 lines
2.4 KiB
Diff
47 lines
2.4 KiB
Diff
From 3037a0a752877e38b6b03ab95371a177ce898e4e 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 ec2f0d269b..a848edfc10 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.19.0
|
|
|