diff options
Diffstat (limited to 'patches/server/0860-Fix-custom-statistic-criteria-creation.patch')
-rw-r--r-- | patches/server/0860-Fix-custom-statistic-criteria-creation.patch | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/patches/server/0860-Fix-custom-statistic-criteria-creation.patch b/patches/server/0860-Fix-custom-statistic-criteria-creation.patch new file mode 100644 index 0000000000..23faf0bb9f --- /dev/null +++ b/patches/server/0860-Fix-custom-statistic-criteria-creation.patch @@ -0,0 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Noah van der Aa <[email protected]> +Date: Sat, 12 Aug 2023 15:33:49 +0200 +Subject: [PATCH] Fix custom statistic criteria creation + + +diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +index 2aa7aad2b4b7f2e7c81ccac28a1e6151055b0ba3..e74f4a16d3e1e7cf716b93057c8b42e8ed0f3503 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +@@ -604,6 +604,14 @@ public final class CraftMagicNumbers implements UnsafeValues { + } + // Paper end - namespaced key biome methods + ++ // Paper start - fix custom stats criteria creation ++ @Override ++ public String getStatisticCriteriaKey(org.bukkit.Statistic statistic) { ++ if (statistic.getType() != org.bukkit.Statistic.Type.UNTYPED) return "minecraft.custom:minecraft." + statistic.getKey().getKey(); ++ return org.bukkit.craftbukkit.CraftStatistic.getNMSStatistic(statistic).getName(); ++ } ++ // Paper end - fix custom stats criteria creation ++ + @Override + public String get(Class<?> aClass, String s) { + if (aClass == Enchantment.class) { |