From 9c1d602d8c39189c789b2ad1859852427e2f65d0 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 20 Sep 2026 06:35:55 +0000 Subject: [PATCH] Update to Minecraft 26.3 SlotDisplay$TagSlotDisplay now carries a HolderSet instead of a TagKey, so the tag name is resolved via HolderSet#unwrapKey. Anonymous holder sets fall through to the stack-resolving branch. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01V35MFZ7JSgoLe79J4d1uxf --- capability/recipehandler/RecipeHandlerHelpers.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/capability/recipehandler/RecipeHandlerHelpers.java b/capability/recipehandler/RecipeHandlerHelpers.java index dd74ab3..6c5bab4 100644 --- a/capability/recipehandler/RecipeHandlerHelpers.java +++ b/capability/recipehandler/RecipeHandlerHelpers.java @@ -1,9 +1,11 @@ package org.cyclops.commoncapabilities.api.capability.recipehandler; import com.google.common.collect.Lists; +import net.minecraft.core.HolderSet; import net.minecraft.recipebook.PlaceRecipeHelper; import net.minecraft.resources.ResourceKey; import net.minecraft.util.context.ContextMap; +import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.Recipe; @@ -43,8 +45,8 @@ public static IPrototypedIngredientAlternatives getPrototype * @return A list of prototyped ingredients. */ public static IPrototypedIngredientAlternatives getPrototypesFromDisplay(SlotDisplay display, int count) { - if (display instanceof SlotDisplay.TagSlotDisplay(net.minecraft.tags.TagKey tag)) { - return new PrototypedIngredientAlternativesItemStackTag(Lists.newArrayList(tag.location().toString()), ItemMatch.ITEM, count); + if (display instanceof SlotDisplay.TagSlotDisplay(HolderSet tag) && tag.unwrapKey().isPresent()) { + return new PrototypedIngredientAlternativesItemStackTag(Lists.newArrayList(tag.unwrapKey().get().location().toString()), ItemMatch.ITEM, count); } else if (display instanceof SlotDisplay.Empty) { return new PrototypedIngredientAlternativesList<>(Lists.newArrayList(new PrototypedIngredient<>(IngredientComponent.ITEMSTACK, ItemStack.EMPTY, ItemMatch.ITEM))); } else if (display instanceof SlotDisplay.ItemStackSlotDisplay(net.minecraft.world.item.ItemStackTemplate stackTemplate)) { @@ -69,8 +71,8 @@ public static IPrototypedIngredientAlternatives getPrototype * @return A list of prototyped ingredients. */ private static IPrototypedIngredientAlternatives getPrototypesFromDisplay(SlotDisplay display, int count, ContextMap contextMap) { - if (display instanceof SlotDisplay.TagSlotDisplay(net.minecraft.tags.TagKey tag)) { - return new PrototypedIngredientAlternativesItemStackTag(Lists.newArrayList(tag.location().toString()), ItemMatch.ITEM, count); + if (display instanceof SlotDisplay.TagSlotDisplay(HolderSet tag) && tag.unwrapKey().isPresent()) { + return new PrototypedIngredientAlternativesItemStackTag(Lists.newArrayList(tag.unwrapKey().get().location().toString()), ItemMatch.ITEM, count); } else if (display instanceof SlotDisplay.Empty) { return new PrototypedIngredientAlternativesList<>(Lists.newArrayList(new PrototypedIngredient<>(IngredientComponent.ITEMSTACK, ItemStack.EMPTY, ItemMatch.ITEM))); } else if (display instanceof SlotDisplay.ItemStackSlotDisplay(net.minecraft.world.item.ItemStackTemplate stackTemplate)) {