Skip to content

Commit

Permalink
Update RecipeManagerMixin.java (QuiltMC#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
Platymemo authored and cocona20xx committed Jan 31, 2024
1 parent 52f07c7 commit b7498aa
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import net.minecraft.inventory.Inventory;
import net.minecraft.item.ItemStack;
import net.minecraft.recipe.Recipe;
import net.minecraft.recipe.RecipeHolder;
import net.minecraft.recipe.RecipeManager;
import net.minecraft.recipe.RecipeType;
import net.minecraft.util.collection.DefaultedList;
Expand All @@ -37,9 +38,9 @@
@Mixin(RecipeManager.class)
public class RecipeManagerMixin {
@Inject(method = "getRemainingStacks", at = @At(value = "RETURN", ordinal = 0), cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD)
public <C extends Inventory, T extends Recipe<C>> void interceptGetRemainingStacks(RecipeType<T> recipeType, C inventory, World world, CallbackInfoReturnable<DefaultedList<ItemStack>> cir, Optional<Recipe<?>> optionalRecipe) {
public <C extends Inventory, T extends Recipe<C>> void interceptGetRemainingStacks(RecipeType<T> recipeType, C inventory, World world, CallbackInfoReturnable<DefaultedList<ItemStack>> cir, Optional<RecipeHolder<?>> optionalRecipe) {
cir.setReturnValue(
RecipeRemainderProvider.getRemainingStacks(inventory, optionalRecipe.get(), cir.getReturnValue())
RecipeRemainderProvider.getRemainingStacks(inventory, optionalRecipe.get().value(), cir.getReturnValue())
);
}
}

0 comments on commit b7498aa

Please sign in to comment.