generated from BocchiKessokuTeam/ForgeTemplateMod-ArchLoom
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
146 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
## Change | ||
- update MaFgLib version | ||
- sync with `sakura-ryoko/itemscroller` 1.21-sakura.8 |
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
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
42 changes: 42 additions & 0 deletions
42
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,51 @@ | ||
package fi.dy.masa.itemscroller.mixin; | ||
|
||
import fi.dy.masa.itemscroller.util.InventoryUtils; | ||
import net.minecraft.client.gui.screen.recipebook.RecipeBookGhostSlots; | ||
import net.minecraft.client.gui.screen.recipebook.RecipeBookWidget; | ||
import net.minecraft.recipe.RecipeEntry; | ||
import net.minecraft.screen.slot.Slot; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import java.util.List; | ||
|
||
@Mixin(RecipeBookWidget.class) | ||
public class MixinRecipeBookWidget | ||
{ | ||
@Shadow @Final protected RecipeBookGhostSlots ghostSlots; | ||
|
||
@Inject(method = "slotClicked", at = @At("HEAD"), cancellable = true) | ||
private void onSlotClicked(Slot slot, CallbackInfo ci) | ||
{ | ||
if (InventoryUtils.dontUpdateRecipeBook > 0) | ||
{ | ||
ci.cancel(); | ||
} | ||
} | ||
|
||
@Inject(method = "update", at = @At("HEAD"), cancellable = true) | ||
private void onUpdate(CallbackInfo ci) | ||
{ | ||
if (InventoryUtils.dontUpdateRecipeBook > 0) | ||
{ | ||
ci.cancel(); | ||
} | ||
} | ||
|
||
// Seems to be (intended) bug from Mojang | ||
@Inject( | ||
method = "showGhostRecipe", | ||
at = @At("HEAD"), | ||
cancellable = true | ||
) | ||
private void onShowGhostRecipe(RecipeEntry<?> recipe, List<Slot> slots, CallbackInfo ci) { | ||
if (this.ghostSlots.getRecipe() == recipe) { | ||
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
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