diff options
Diffstat (limited to 'patches/server/0594-Add-ItemFactory-getSpawnEgg-API.patch')
-rw-r--r-- | patches/server/0594-Add-ItemFactory-getSpawnEgg-API.patch | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/patches/server/0594-Add-ItemFactory-getSpawnEgg-API.patch b/patches/server/0594-Add-ItemFactory-getSpawnEgg-API.patch index 925a23a50d..6b1d0721f9 100644 --- a/patches/server/0594-Add-ItemFactory-getSpawnEgg-API.patch +++ b/patches/server/0594-Add-ItemFactory-getSpawnEgg-API.patch @@ -5,10 +5,18 @@ Subject: [PATCH] Add ItemFactory#getSpawnEgg API diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index a96a09bb39fc35f3c4dfcd0da0ce1fe283b8377e..31a33e329ee06860f8845d201d32ee86a274a657 100644 +index a96a09bb39fc35f3c4dfcd0da0ce1fe283b8377e..cd0b6819da81978b9186c83ee926e1fed5ee6fe4 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -@@ -590,4 +590,19 @@ public final class CraftItemFactory implements ItemFactory { +@@ -9,6 +9,7 @@ import net.minecraft.core.HolderSet; + import net.minecraft.core.RegistryAccess; + import net.minecraft.core.component.DataComponentPatch; + import net.minecraft.core.registries.Registries; ++import net.minecraft.resources.ResourceLocation; + import net.minecraft.server.MinecraftServer; + import net.minecraft.tags.EnchantmentTags; + import net.minecraft.util.RandomSource; +@@ -590,4 +591,19 @@ public final class CraftItemFactory implements ItemFactory { new net.md_5.bungee.api.chat.TextComponent(customName)); } // Paper end - bungee hover events @@ -21,7 +29,7 @@ index a96a09bb39fc35f3c4dfcd0da0ce1fe283b8377e..31a33e329ee06860f8845d201d32ee86 + return null; + } + String typeId = type.getKey().toString(); -+ net.minecraft.resources.ResourceLocation typeKey = new net.minecraft.resources.ResourceLocation(typeId); ++ net.minecraft.resources.ResourceLocation typeKey = ResourceLocation.parse(typeId); + net.minecraft.world.entity.EntityType<?> nmsType = net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.get(typeKey); + net.minecraft.world.item.SpawnEggItem eggItem = net.minecraft.world.item.SpawnEggItem.byId(nmsType); + return eggItem == null ? null : new net.minecraft.world.item.ItemStack(eggItem).asBukkitMirror(); |