mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-22 10:35:38 +01:00
26 lines
1.3 KiB
Diff
26 lines
1.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Noah van der Aa <ndvdaa@gmail.com>
|
|
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 a5a3a0f0460252415c243dfe3019d103b9589c5b..a4998c2df341a1b9a337afb24284428cd98e59d8 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
|
@@ -599,6 +599,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) {
|