diff --git a/src/main/java/net/frozenblock/lib/recipe/mixin/ShapedRecipeBuilderMixin.java b/src/main/java/net/frozenblock/lib/recipe/mixin/ShapedRecipeBuilderMixin.java index c9b9ee5f0..a595f64dc 100644 --- a/src/main/java/net/frozenblock/lib/recipe/mixin/ShapedRecipeBuilderMixin.java +++ b/src/main/java/net/frozenblock/lib/recipe/mixin/ShapedRecipeBuilderMixin.java @@ -21,10 +21,13 @@ import com.llamalad7.mixinextras.injector.wrapoperation.Operation; import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; import net.frozenblock.lib.recipe.api.ShapedRecipeBuilderExtension; +import net.minecraft.advancements.AdvancementHolder; import net.minecraft.data.recipes.RecipeOutput; import net.minecraft.data.recipes.ShapedRecipeBuilder; import net.minecraft.nbt.CompoundTag; import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.item.crafting.ShapedRecipe; import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; @@ -57,9 +60,9 @@ public class ShapedRecipeBuilderMixin implements ShapedRecipeBuilderExtension { target = "Lnet/minecraft/data/recipes/RecipeOutput;accept(Lnet/minecraft/resources/ResourceLocation;Lnet/minecraft/world/item/crafting/Recipe;Lnet/minecraft/advancements/AdvancementHolder;)V" ) ) - private void modifySave(RecipeOutput instance, ResourceLocation recipe, Operation operation) { + private void modifySave(RecipeOutput instance, ResourceLocation recipeId, Recipe recipe, AdvancementHolder holder, Operation operation) { ((ShapedRecipeBuilderExtension) recipe).frozenLib$tag(this.tag); - operation.call(instance, recipe); + operation.call(instance, recipeId, recipe, holder); } /*@Mixin(ShapedRecipeBuilder.Result.class) diff --git a/src/main/java/net/frozenblock/lib/recipe/mixin/ShapedRecipeMixin.java b/src/main/java/net/frozenblock/lib/recipe/mixin/ShapedRecipeMixin.java index 5fb162279..798498dbc 100644 --- a/src/main/java/net/frozenblock/lib/recipe/mixin/ShapedRecipeMixin.java +++ b/src/main/java/net/frozenblock/lib/recipe/mixin/ShapedRecipeMixin.java @@ -21,26 +21,29 @@ import net.frozenblock.lib.recipe.api.ShapedRecipeBuilderExtension; import net.minecraft.data.recipes.ShapedRecipeBuilder; import net.minecraft.nbt.CompoundTag; +import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.ShapedRecipe; import org.jetbrains.annotations.Nullable; +import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Unique; @Mixin(ShapedRecipe.class) public class ShapedRecipeMixin implements ShapedRecipeBuilderExtension { - @Unique - @Nullable - private CompoundTag tag; + @Shadow + @Final + ItemStack result; @Override public ShapedRecipeBuilder frozenLib$tag(@Nullable CompoundTag tag) { - this.tag = tag; + this.result.setTag(tag); return null; } @Override public @Nullable CompoundTag frozenLib$getTag() { - return this.tag; + return this.result.getTag(); } } diff --git a/src/main/resources/mixin/frozenlib.recipe.mixins.json b/src/main/resources/mixin/frozenlib.recipe.mixins.json index 890dab2ac..71fd18119 100644 --- a/src/main/resources/mixin/frozenlib.recipe.mixins.json +++ b/src/main/resources/mixin/frozenlib.recipe.mixins.json @@ -9,6 +9,7 @@ "mixins": [ "ItemStackMixin", "ItemValueMixin", - "ShapedRecipeBuilderMixin" + "ShapedRecipeBuilderMixin", + "ShapedRecipeMixin" ] }