2023-08-12 23:50:21 +02:00
|
|
|
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
|
2024-07-19 13:08:08 +02:00
|
|
|
index 24cb9d97bb04a4fe60c46055520ec324fbf6fa3b..398068e8ffa77ac7199baf7aaab5b60c9dc639f5 100644
|
2023-08-12 23:50:21 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
2024-07-19 13:08:08 +02:00
|
|
|
@@ -593,6 +593,14 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
2023-08-12 23:50:21 +02:00
|
|
|
}
|
2024-05-23 19:32:02 +02:00
|
|
|
// Paper end - namespaced key biome methods
|
|
|
|
|
|
|
|
+ // Paper start - fix custom stats criteria creation
|
2023-08-12 23:50:21 +02:00
|
|
|
+ @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();
|
|
|
|
+ }
|
2024-05-23 19:32:02 +02:00
|
|
|
+ // Paper end - fix custom stats criteria creation
|
|
|
|
+
|
2024-05-11 23:48:37 +02:00
|
|
|
@Override
|
2024-05-23 19:32:02 +02:00
|
|
|
public String get(Class<?> aClass, String s) {
|
|
|
|
if (aClass == Enchantment.class) {
|