From 0ad3f7821fd819b43b58720de6713ed8bb8c9a8d Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 5 Jan 2019 22:14:37 +0800 Subject: Buggy Autocrafting --- .../shedaniel/mixins/MixinBrewingRecipeRegistry.java | 2 +- .../java/me/shedaniel/mixins/MixinRecipeBookGui.java | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 src/main/java/me/shedaniel/mixins/MixinRecipeBookGui.java (limited to 'src/main/java/me/shedaniel/mixins') diff --git a/src/main/java/me/shedaniel/mixins/MixinBrewingRecipeRegistry.java b/src/main/java/me/shedaniel/mixins/MixinBrewingRecipeRegistry.java index bc36c8315..e34a2682e 100644 --- a/src/main/java/me/shedaniel/mixins/MixinBrewingRecipeRegistry.java +++ b/src/main/java/me/shedaniel/mixins/MixinBrewingRecipeRegistry.java @@ -13,7 +13,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(BrewingRecipeRegistry.class) public class MixinBrewingRecipeRegistry { - @Inject(method = "registerPotionRecipe", at = @At("RETURN")) + @Inject(method = "registerPotionRecipe", at = @At("HEAD")) private static void registerPotionRecipe(Potion potion_1, Item item_1, Potion potion_2, CallbackInfo info) { Core.getListeners(PotionCraftingAdder.class).forEach(potionCraftingAdder -> potionCraftingAdder.addPotionRecipe(potion_1, item_1, potion_2)); } diff --git a/src/main/java/me/shedaniel/mixins/MixinRecipeBookGui.java b/src/main/java/me/shedaniel/mixins/MixinRecipeBookGui.java new file mode 100644 index 000000000..d685ba1e6 --- /dev/null +++ b/src/main/java/me/shedaniel/mixins/MixinRecipeBookGui.java @@ -0,0 +1,20 @@ +package me.shedaniel.mixins; + +import me.shedaniel.listenerdefinitions.IMixinRecipeBookGui; +import net.minecraft.client.gui.recipebook.RecipeBookGui; +import net.minecraft.client.gui.widget.RecipeBookGhostSlots; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; + +@Mixin(RecipeBookGui.class) +public class MixinRecipeBookGui implements IMixinRecipeBookGui { + + @Shadow @Final protected RecipeBookGhostSlots ghostSlots; + + @Override + public RecipeBookGhostSlots getGhostSlots() { + return ghostSlots; + } + +} -- cgit