From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Noah van der Aa 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 ba82266c6f3e9e8f325b799171e8346a32033126..9b98070aa4998071b0821605f1f9bc1622716938 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -587,6 +587,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) {