aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0880-Fix-custom-statistic-criteria-creation.patch
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2024-04-27 15:50:33 -0700
committerJake Potrebic <[email protected]>2024-04-27 15:50:38 -0700
commitd02bb811de6f9d7e42001137b93d6a6f88359ab6 (patch)
treea396cbb1f0ada45b98703f8125f06f17334dc080 /patches/server/0880-Fix-custom-statistic-criteria-creation.patch
parentdd571d89f2202bda719a40fd15f92cc754b6ade1 (diff)
downloadPaper-d02bb811de6f9d7e42001137b93d6a6f88359ab6.tar.gz
Paper-d02bb811de6f9d7e42001137b93d6a6f88359ab6.zip
proper migration to gamerules for keep spawn loaded distance
Diffstat (limited to 'patches/server/0880-Fix-custom-statistic-criteria-creation.patch')
-rw-r--r--patches/server/0880-Fix-custom-statistic-criteria-creation.patch23
1 files changed, 23 insertions, 0 deletions
diff --git a/patches/server/0880-Fix-custom-statistic-criteria-creation.patch b/patches/server/0880-Fix-custom-statistic-criteria-creation.patch
new file mode 100644
index 0000000000..c15d703018
--- /dev/null
+++ b/patches/server/0880-Fix-custom-statistic-criteria-creation.patch
@@ -0,0 +1,23 @@
+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 c4e517ef6cf5cd4975846459cf66ebd4db66a805..6e19867f0c242a735801974a8b0332485f450017 100644
+--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
++++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+@@ -617,6 +617,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
+ net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> biomeBase = cra.getHandle().registryAccess().registryOrThrow(net.minecraft.core.registries.Registries.BIOME).getHolderOrThrow(net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.BIOME, org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(biomeKey)));
+ cra.setBiome(x, y, z, biomeBase);
+ }
++
++ @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
+
+ /**