Added attachment copying to RecipeKeepDataShaped

This commit is contained in:
Flanks255 2024-03-13 17:05:00 -05:00
parent 911356adbc
commit 99ea93ebad

View file

@ -10,6 +10,7 @@ import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraft.world.item.crafting.ShapedRecipe;
import net.neoforged.neoforge.attachment.AttachmentInternals;
import javax.annotation.Nullable;
@ -44,6 +45,9 @@ public class RecipeKeepDataShaped extends ShapedRecipe {
if (!datasource.isEmpty() && datasource.hasTag())
craftingResult.setTag(datasource.getTag().copy());
if (!datasource.isEmpty())
AttachmentInternals.copyStackAttachments(datasource, craftingResult);
return craftingResult;
}