forked from Minecraft-AMS/itemscroller-crafting-fix
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reintroduce recipeBook crafting with fix on vanillaRecipe finding
- Loading branch information
1 parent
0be120c
commit ae02150
Showing
6 changed files
with
102 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/main/java/fi/dy/masa/itemscroller/mixin/MixinRecipeBookWidget.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
package fi.dy.masa.itemscroller.mixin; | ||
|
||
import fi.dy.masa.itemscroller.util.InventoryUtils; | ||
import net.minecraft.client.gui.screen.recipebook.RecipeBookWidget; | ||
import net.minecraft.screen.slot.Slot; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(RecipeBookWidget.class) | ||
public class MixinRecipeBookWidget | ||
{ | ||
@Inject(method = "slotClicked", at = @At("HEAD"), cancellable = true) | ||
private void onSlotClicked(Slot slot, CallbackInfo ci) | ||
{ | ||
if (InventoryUtils.dontUpdateRecipeBook) | ||
{ | ||
ci.cancel(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters