Skip to content

Commit

Permalink
Fix mixin with latest tweakeroo (#150)
Browse files Browse the repository at this point in the history
Signed-off-by: Hendrix-Shen <[email protected]>
  • Loading branch information
Hendrix-Shen authored Jan 5, 2025
1 parent e270cf5 commit bbe271e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 11 deletions.
7 changes: 5 additions & 2 deletions src/main/java/com/plusls/MasaGadget/game/Configs.java
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,16 @@ public class Configs {
@Config(category = ConfigCategory.TWEAKEROO)
public static MagicConfigBoolean inventoryPreviewSyncDataClientOnly = Configs.cf.newConfigBoolean("inventoryPreviewSyncDataClientOnly", false);

@Dependencies(require = @Dependency(ModId.tweakeroo))
@Dependencies(
require = @Dependency(ModId.tweakeroo),
conflict = @Dependency(value = ModId.minecraft, versionPredicates = ">=1.21-")
)
@Config(category = ConfigCategory.TWEAKEROO)
public static MagicConfigBoolean inventoryPreviewUseCache = Configs.cf.newConfigBoolean("inventoryPreviewUseCache", false);

@Dependencies(require = {
@Dependency(ModId.tweakeroo),
@Dependency(ModId.tweakeroo)
@Dependency(ModId.itemscroller)
})
@Config(category = ConfigCategory.TWEAKEROO)
public static MagicConfigBoolean restockWithCrafting = Configs.cf.newConfigBoolean("restockWithCrafting", false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,19 @@
public abstract class MixinRenderUtils {
//#if MC > 11904
//$$ @Unique
//$$ private static GuiGraphics masa_gadget$gui;
//$$ private static GuiGraphics masa_gadget$guiGraphics;
//$$
//$$ @Inject(method = "renderInventoryOverlay", at = @At("HEAD"))
//$$ private static void intercept(Minecraft mc, GuiGraphics gui, CallbackInfo ci) {
//$$ MixinRenderUtils.masa_gadget$gui = gui;
//$$ private static void intercept(
//#if MC > 12006
//$$ InventoryOverlay.Context context,
//#else
//$$ Minecraft mc,
//#endif
//$$ GuiGraphics guiGraphics,
//$$ CallbackInfo ci
//$$ ) {
//$$ MixinRenderUtils.masa_gadget$guiGraphics = guiGraphics;
//$$ }
//#endif

Expand Down Expand Up @@ -78,7 +86,7 @@ private static Container modifyInv(Container inv) {
27,
Minecraft.getInstance()
//#if MC > 11904
//$$ , masa_gadget$gui
//$$ , masa_gadget$guiGraphics
//#endif
);
fi.dy.masa.malilib.render.RenderUtils.color(1.0F, 1.0F, 1.0F, 1.0F);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,19 @@
public class MixinRenderUtils {
//#if MC > 11904
//$$ @Unique
//$$ private static GuiGraphics masa_gadget_mod$gui;
//$$ private static GuiGraphics masa_gadget$guiGraphics;
//$$
//$$ @Inject(method = "renderInventoryOverlay", at = @At("HEAD"))
//$$ private static void intercept(Minecraft mc, GuiGraphics gui, CallbackInfo ci) {
//$$ MixinRenderUtils.masa_gadget_mod$gui = gui;
//$$ private static void intercept(
//#if MC > 12006
//$$ InventoryOverlay.Context context,
//#else
//$$ Minecraft mc,
//#endif
//$$ GuiGraphics guiGraphics,
//$$ CallbackInfo ci
//$$ ) {
//$$ MixinRenderUtils.masa_gadget$guiGraphics = guiGraphics;
//$$ }
//#endif

Expand Down Expand Up @@ -110,7 +118,7 @@ private static Container renderTradeOfferList(Container inv) {
MixinRenderUtils.masa_gadget$maxTradeOfferSize,
Minecraft.getInstance()
//#if MC > 11904
//$$ , masa_gadget_mod$gui
//$$ , masa_gadget$guiGraphics
//#endif
);
fi.dy.masa.malilib.render.RenderUtils.color(1.0F, 1.0F, 1.0F, 1.0F);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
import top.hendrixshen.magiclib.api.dependency.annotation.Dependencies;
import top.hendrixshen.magiclib.api.dependency.annotation.Dependency;

@Dependencies(require = @Dependency(ModId.tweakeroo))
@Dependencies(
require = @Dependency(ModId.tweakeroo),
conflict = @Dependency(value = ModId.minecraft, versionPredicates = ">=1.21-")
)
@Mixin(value = RenderUtils.class, remap = false)
public class MixinMixinRenderUtils {
@Redirect(
Expand Down

0 comments on commit bbe271e

Please sign in to comment.