Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
closes #152

(cherry picked from commit d5bdfb3)
  • Loading branch information
deirn committed Feb 18, 2023
1 parent 09bdb2a commit 70c8d16
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ wthit = 5.10.0
badpackets = 0.2.1

# Recipe Viewer
recipeViewer = jei
recipeViewer = emi
rei = 9.1.526
jei = 1.19.2-11.5.2.1007
emi = 0.6.3+1.19.2
Expand Down
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;
}
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package badasintended.slotlink.mixin.pseudo;
package badasintended.slotlink.mixin.invsorter;

import badasintended.slotlink.compat.invsort.InventorySortButton;
import net.minecraft.client.gui.widget.TexturedButtonWidget;
Expand Down
8 changes: 6 additions & 2 deletions src/main/resources/slotlink.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
"package" : "badasintended.slotlink.mixin",
"compatibilityLevel": "JAVA_16",
"mixins" : [
"CraftingScreenHandlerAccessor", "PlayerEntityMixin", "RecipeManagerAccessor", "ServerWorldMixin",
"CraftingScreenHandlerAccessor",
"PlayerEntityMixin",
"RecipeManagerAccessor",
"ServerWorldMixin",
"WallMountedBlockMixin"
],
"client" : [
"HandledScreenAccessor",
"TextFieldWidgetAccessor",
"pseudo.SortButtonWidgetMixin"
"emi.EmiRecipeFillerMixin",
"invsorter.SortButtonWidgetMixin"
],
"injectors" : {
"defaultRequire": 1
Expand Down

0 comments on commit 70c8d16

Please sign in to comment.