-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
4 changed files
with
34 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
26 changes: 26 additions & 0 deletions
26
src/main/java/badasintended/slotlink/mixin/emi/EmiRecipeFillerMixin.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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package badasintended.slotlink.mixin.emi; | ||
|
||
import dev.emi.emi.EmiRecipeFiller; | ||
import dev.emi.emi.mixin.accessor.ScreenHandlerAccessor; | ||
import net.minecraft.screen.PlayerScreenHandler; | ||
import net.minecraft.screen.ScreenHandler; | ||
import net.minecraft.screen.ScreenHandlerType; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
// TODO: remove if new emi version is released | ||
@Mixin(EmiRecipeFiller.class) | ||
public abstract class EmiRecipeFillerMixin { | ||
|
||
// https://github.com/emilyploszaj/emi/pull/136 | ||
@Redirect(require = 0, method = "getAllHandlers", at = @At(value = "INVOKE", target = "Ldev/emi/emi/mixin/accessor/ScreenHandlerAccessor;emi$getType()Lnet/minecraft/screen/ScreenHandlerType;")) | ||
private static ScreenHandlerType<?> slotlink(ScreenHandlerAccessor instance) { | ||
try { | ||
return instance instanceof PlayerScreenHandler ? null : ((ScreenHandler) instance).getType(); | ||
} catch (UnsupportedOperationException e) { | ||
return null; | ||
} | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
...k/mixin/pseudo/SortButtonWidgetMixin.java → ...ixin/invsorter/SortButtonWidgetMixin.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
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