Skip to content

Commit

Permalink
Switch to new Mod loaded checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ALongStringOfNumbers committed Feb 25, 2024
1 parent 0d53384 commit a70dfdc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 18 deletions.
2 changes: 2 additions & 0 deletions src/main/java/gregtech/api/util/Mods.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public enum Mods {
InventoryTweaks(Names.INVENTORY_TWEAKS),
JourneyMap(Names.JOURNEY_MAP),
JustEnoughItems(Names.JUST_ENOUGH_ITEMS),
LittleTiles(Names.LITTLE_TILES),
MagicBees(Names.MAGIC_BEES),
Nothirium(Names.NOTHIRIUM),
NuclearCraft(Names.NUCLEAR_CRAFT, versionExcludes("2o")),
Expand Down Expand Up @@ -122,6 +123,7 @@ public static class Names {
public static final String INVENTORY_TWEAKS = "inventorytweaks";
public static final String JOURNEY_MAP = "journeymap";
public static final String JUST_ENOUGH_ITEMS = "jei";
public static final String LITTLE_TILES = "littletiles";
public static final String MAGIC_BEES = "magicbees";
public static final String NOTHIRIUM = "nothirium";
public static final String NUCLEAR_CRAFT = "nuclearcraft";
Expand Down
8 changes: 0 additions & 8 deletions src/main/java/gregtech/asm/GregTechTransformer.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
package gregtech.asm;

import gregtech.api.util.Mods;
import gregtech.asm.util.ObfMapping;
import gregtech.asm.util.TargetClassVisitor;
import gregtech.asm.visitors.EnchantmentCanApplyVisitor;
import gregtech.asm.visitors.JEIVisitor;
import gregtech.asm.visitors.LittleTilesVisitor;

import net.minecraft.launchwrapper.IClassTransformer;
import net.minecraft.launchwrapper.Launch;

import org.objectweb.asm.Opcodes;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package gregtech.mixins;

import gregtech.api.GTValues;

import net.minecraftforge.fml.common.Loader;
import gregtech.api.util.Mods;

import zone.rong.mixinbooter.ILateMixinLoader;

Expand All @@ -27,10 +25,10 @@ public List<String> getMixinConfigs() {
@Override
public boolean shouldMixinConfigQueue(String mixinConfig) {
return switch (mixinConfig) {
case "mixins.gregtech.theoneprobe.json" -> Loader.isModLoaded(GTValues.MODID_TOP);
case "mixins.gregtech.jei.json" -> Loader.isModLoaded(GTValues.MODID_JEI);
case "mixin.gregtech.ctm.json" -> Loader.isModLoaded(GTValues.MODID_CTM);
case "mixins.gregtech.littletiles.json" -> Loader.isModLoaded(GTValues.MODID_LITTLETILES);
case "mixins.gregtech.theoneprobe.json" -> Mods.TheOneProbe.isModLoaded();
case "mixins.gregtech.jei.json" -> Mods.JustEnoughItems.isModLoaded();
case "mixin.gregtech.ctm.json" -> Mods.CTM.isModLoaded();
case "mixins.gregtech.littletiles.json" -> Mods.LittleTiles.isModLoaded();
default -> true;
};
}
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/gregtech/mixins/minecraft/RenderItemMixin.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package gregtech.mixins.minecraft;

import gregtech.api.GTValues;
import gregtech.api.util.Mods;
import gregtech.asm.hooks.RenderItemHooks;

import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.RenderItem;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.Loader;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -32,7 +31,7 @@ private void renderItemOverlayIntoGUIInject(FontRenderer fr, ItemStack stack, in
ordinal = 0))
public void showDurabilityBarMixin(FontRenderer fr, ItemStack stack, int xPosition, int yPosition, String text,
CallbackInfo ci) {
if (!Loader.isModLoaded(GTValues.MODID_ECORE)) {
if (!Mods.EnderCore.isModLoaded()) {
RenderItemHooks.renderElectricBar(stack, xPosition, yPosition);
}
}
Expand Down

0 comments on commit a70dfdc

Please sign in to comment.