From 57c75a4b67a8b3b3c607126130b7503658b5e98a Mon Sep 17 00:00:00 2001 From: TonytheMacaroni Date: Wed, 9 Oct 2024 16:58:13 -0400 Subject: [PATCH] Fix CraftMagicNumbers#getTag (#11484) --- patches/server/1014-Registry-Modification-API.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/patches/server/1014-Registry-Modification-API.patch b/patches/server/1014-Registry-Modification-API.patch index 58d297a22b..c31982d8a2 100644 --- a/patches/server/1014-Registry-Modification-API.patch +++ b/patches/server/1014-Registry-Modification-API.patch @@ -9,7 +9,7 @@ public net.minecraft.resources.RegistryOps lookupProvider public net.minecraft.resources.RegistryOps$HolderLookupAdapter diff --git a/src/main/java/io/papermc/paper/registry/PaperRegistries.java b/src/main/java/io/papermc/paper/registry/PaperRegistries.java -index c92ce42398a9bfd00eb4e05972289c521ee255cf..fba7c1758439db9044d9f7368bc9b79642d6b1b9 100644 +index 633b01431750d4b40159a57bf25fb35c6670ff1b..5cf598905ed6a7ac2b0d9ced3420adaf20ceb6af 100644 --- a/src/main/java/io/papermc/paper/registry/PaperRegistries.java +++ b/src/main/java/io/papermc/paper/registry/PaperRegistries.java @@ -2,6 +2,7 @@ package io.papermc.paper.registry; @@ -1357,7 +1357,7 @@ index bd16933a5341908b21e549f66080c33466ad1079..90046c85ce1b9901de7476761da15614 + // Paper end - RegistrySet API } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 9e0d8fc51196ca07677f45e41614262036155e85..82ebfd09e9baca0a31ee41c0e5228bce3c54e74f 100644 +index 9e0d8fc51196ca07677f45e41614262036155e85..0286375531b944ce572708e6c7cc9982e0d2b5b8 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -668,6 +668,21 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -1367,7 +1367,7 @@ index 9e0d8fc51196ca07677f45e41614262036155e85..82ebfd09e9baca0a31ee41c0e5228bce + // Paper start - hack to get tags for non server-backed registries + @Override + public io.papermc.paper.registry.tag.Tag getTag(final io.papermc.paper.registry.tag.TagKey tagKey) { // TODO remove Keyed -+ if (tagKey.registryKey() != io.papermc.paper.registry.RegistryKey.ENTITY_TYPE || tagKey.registryKey() != io.papermc.paper.registry.RegistryKey.FLUID) { ++ if (tagKey.registryKey() != io.papermc.paper.registry.RegistryKey.ENTITY_TYPE && tagKey.registryKey() != io.papermc.paper.registry.RegistryKey.FLUID) { + throw new UnsupportedOperationException(tagKey.registryKey() + " doesn't have tags"); + } + final net.minecraft.resources.ResourceKey> nmsKey = io.papermc.paper.registry.PaperRegistries.registryToNms(tagKey.registryKey());