Skip to content

Commit

Permalink
fix mod deps
Browse files Browse the repository at this point in the history
  • Loading branch information
plusls committed Oct 24, 2021
1 parent b1a07ae commit 9c5515c
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tweakeroo_version=3383609
# litematica-fabric-1.17.1-0.0.0-dev.20210713.103711.jar
litematica_version=3387062
multiconnect_version=1.4.15
mod_menu_version=2.0.2
mod_menu_version=2.0.14
# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.40.8+1.17
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ public class MasaGadgetMixinPlugin implements IMixinConfigPlugin {
public static final String TWEAKEROO_MOD_ID = "tweakeroo";
public static final String MINIHUD_MOD_ID = "minihud";
public static final String LITEMATICA_MOD_ID = "litematica";
public static final String MODMENU_MOD_ID = "modmenu";
public static final String BBOR_MOD_ID = "bbor";

public static boolean isTweakerooLoaded = false;
public static boolean isMinihudLoaded = false;
public static boolean isLitematicaLoaded = false;
public static boolean isBborLoaded = false;
public static boolean isModmenu = false;

private final List<String> obfuscatedMixinList = new ArrayList<>();
static private Path tempDirectory;
Expand Down Expand Up @@ -69,6 +71,7 @@ public void onLoad(String mixinPackage) {
isMinihudLoaded = FabricLoader.getInstance().isModLoaded(MINIHUD_MOD_ID);
isLitematicaLoaded = FabricLoader.getInstance().isModLoaded(LITEMATICA_MOD_ID);
isBborLoaded = FabricLoader.getInstance().isModLoaded(BBOR_MOD_ID);
isModmenu = FabricLoader.getInstance().isModLoaded(MODMENU_MOD_ID);
if (!FabricLoader.getInstance().isDevelopmentEnvironment()) {
Object urlLoader = Thread.currentThread().getContextClassLoader();
Class<?> knotClassLoader;
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/com/plusls/MasaGadget/config/Configs.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,17 @@ public static class Malilib {
FIX_GET_INVENTORY_TYPE,
OPTIMIZE_CONFIG_WIDGET_SEARCH
);

public static final List<IConfigBase> GUI_OPTIONS = new LinkedList<>(OPTIONS);

static {
GUI_OPTIONS.removeIf(iConfigBase -> {
if (iConfigBase == FAST_SWITCH_MASA_CONFIG_GUI && !MasaGadgetMixinPlugin.isModmenu) {
return true;
}
return false;
});
}
}

public static class Minihud {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/plusls/MasaGadget/gui/GuiConfigs.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public List<ConfigOptionWrapper> getConfigs() {
} else if (tab == ConfigGuiTab.LITEMATICA) {
configs = Configs.Litematica.GUI_OPTIONS;
} else if (tab == ConfigGuiTab.MALILIB) {
configs = Configs.Malilib.OPTIONS;
configs = Configs.Malilib.GUI_OPTIONS;
} else if (tab == ConfigGuiTab.MINIHUD) {
configs = Configs.Minihud.GUI_OPTIONS;
} else if (tab == ConfigGuiTab.TWEAKEROO) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.plusls.MasaGadget.malilib.fastSwitchMasaConfigGui;

import com.plusls.MasaGadget.MasaGadgetMixinPlugin;
import com.plusls.MasaGadget.ModInfo;
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
import com.terraformersmc.modmenu.api.ModMenuApi;
Expand All @@ -23,7 +24,9 @@ public static void init() {
}

public static void initMasaModScreenList(MinecraftClient client) {

if (!MasaGadgetMixinPlugin.isModmenu) {
return;
}
FabricLoader.getInstance().getEntrypointContainers("modmenu", ModMenuApiMarker.class).forEach(entrypoint -> {
ModMetadata metadata = entrypoint.getProvider().getMetadata();
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyVariable;

@Dependencies(dependencyList = @Dependency(modId = MasaGadgetMixinPlugin.LITEMATICA_MOD_ID, version = "<" + LitematicaDependencyUtil.NUDGE_SELECTION_SUPPORT_FREECAMERA_BREAK_VERSION,
predicate = LitematicaDependencyUtil.TweakerooPredicate.class))
@Dependencies(dependencyList = {@Dependency(modId = MasaGadgetMixinPlugin.LITEMATICA_MOD_ID, version = "<" + LitematicaDependencyUtil.NUDGE_SELECTION_SUPPORT_FREECAMERA_BREAK_VERSION,
predicate = LitematicaDependencyUtil.TweakerooPredicate.class),
@Dependency(modId = MasaGadgetMixinPlugin.TWEAKEROO_MOD_ID, version = "*")})
@Mixin(value = InputHandler.class, remap = false)
public class MixinInputHandler {
@ModifyVariable(method = "nudgeSelection", at = @At(value = "HEAD"), ordinal = 0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.plusls.MasaGadget.mixin.malilib.fastSwitchMasaConfigGui;

import com.plusls.MasaGadget.MasaGadgetMixinPlugin;
import com.plusls.MasaGadget.config.Configs;
import com.plusls.MasaGadget.gui.MyWidgetDropDownList;
import com.plusls.MasaGadget.malilib.fastSwitchMasaConfigGui.MasaGuiUtil;
import com.plusls.MasaGadget.mixin.Dependencies;
import com.plusls.MasaGadget.mixin.Dependency;
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
import fi.dy.masa.malilib.gui.GuiBase;
import fi.dy.masa.malilib.gui.GuiConfigsBase;
Expand All @@ -19,6 +22,7 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Dependencies(dependencyList = @Dependency(modId = MasaGadgetMixinPlugin.MODMENU_MOD_ID, version = "*"))
@Mixin(value = GuiConfigsBase.class, remap = false)
public abstract class MixinGuiConfigBase extends GuiListBase<GuiConfigsBase.ConfigOptionWrapper, WidgetConfigOption, WidgetListConfigOptions> implements IKeybindConfigGui {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.plusls.MasaGadget.mixin.Dependency;
import fi.dy.masa.tweakeroo.renderer.RenderUtils;
import net.minecraft.block.ShulkerBoxBlock;
import net.minecraft.block.entity.ShulkerBoxBlockEntity;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.Entity;
Expand Down

0 comments on commit 9c5515c

Please sign in to comment.