This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
generated from GregTech-Intergalactical/ExampleMod
-
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.
tried mixining jei to get the feature I wanted, but doesn't seem to b…
…e working
- Loading branch information
Showing
6 changed files
with
84 additions
and
1 deletion.
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
23 changes: 23 additions & 0 deletions
23
.../main/java/io/github/gregtechintergalactical/gtcore/mixin/jei/FocusInputHandlerMixin.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,23 @@ | ||
package io.github.gregtechintergalactical.gtcore.mixin.jei; | ||
|
||
import io.github.gregtechintergalactical.gtcore.GTCore; | ||
import mezz.jei.api.ingredients.ITypedIngredient; | ||
import mezz.jei.common.input.IClickedIngredient; | ||
import mezz.jei.common.input.handlers.FocusInputHandler; | ||
import net.minecraft.world.item.ItemStack; | ||
import org.spongepowered.asm.mixin.Debug; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Debug(export = true) | ||
@Mixin(FocusInputHandler.class) | ||
public class FocusInputHandlerMixin { | ||
@Redirect(method = "lambda$handleShow$0", at = @At(value = "INVOKE", target = "Lmezz/jei/common/input/IClickedIngredient;getTypedIngredient()Lmezz/jei/api/ingredients/ITypedIngredient;"), remap = false) | ||
private static ITypedIngredient<?> gtcore$redirectSelectorTag(IClickedIngredient<?> instance){ | ||
if (instance.getTypedIngredient().getIngredient() instanceof ItemStack stack){ | ||
GTCore.LOGGER.info(instance.getTypedIngredient()); | ||
} | ||
return instance.getTypedIngredient(); | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
common/src/main/java/io/github/gregtechintergalactical/gtcore/mixin/jei/JEIMixinPlugin.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,48 @@ | ||
package io.github.gregtechintergalactical.gtcore.mixin.jei; | ||
|
||
import muramasa.antimatter.Ref; | ||
import muramasa.antimatter.util.AntimatterPreLaunchUtil; | ||
import org.objectweb.asm.tree.ClassNode; | ||
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; | ||
import org.spongepowered.asm.mixin.extensibility.IMixinInfo; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
|
||
public class JEIMixinPlugin implements IMixinConfigPlugin { | ||
@Override | ||
public void onLoad(String mixinPackage) { | ||
|
||
} | ||
|
||
@Override | ||
public String getRefMapperConfig() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { | ||
return false; | ||
//return AntimatterPreLaunchUtil.INSTANCE.isModLoaded(Ref.MOD_JEI); | ||
} | ||
|
||
@Override | ||
public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) { | ||
|
||
} | ||
|
||
@Override | ||
public List<String> getMixins() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { | ||
|
||
} | ||
|
||
@Override | ||
public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { | ||
|
||
} | ||
} |
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,10 @@ | ||
{ | ||
"required": true, | ||
"package": "io.github.gregtechintergalactical.gtcore.mixin.jei", | ||
"compatibilityLevel": "JAVA_17", | ||
"minVersion": "0.8", | ||
"plugin": "io.github.gregtechintergalactical.gtcore.mixin.jei.JEIMixinPlugin", | ||
"mixins": [ | ||
"FocusInputHandlerMixin" | ||
] | ||
} |
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