diff --git a/src/main/java/com/falsepattern/gasstation/mixins/mixin/dev/ModDiscovererMixin.java b/src/main/java/com/falsepattern/gasstation/mixins/mixin/dev/ModDiscovererMixin.java index 66ca0ab..4d83e1a 100644 --- a/src/main/java/com/falsepattern/gasstation/mixins/mixin/dev/ModDiscovererMixin.java +++ b/src/main/java/com/falsepattern/gasstation/mixins/mixin/dev/ModDiscovererMixin.java @@ -4,18 +4,12 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.Redirect; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import org.spongepowered.asm.mixin.injection.callback.LocalCapture; +import org.spongepowered.asm.mixin.injection.ModifyVariable; -import cpw.mods.fml.common.FMLLog; -import cpw.mods.fml.common.ModClassLoader; -import cpw.mods.fml.common.discovery.ContainerType; import cpw.mods.fml.common.discovery.ModCandidate; import cpw.mods.fml.common.discovery.ModDiscoverer; -import java.io.File; +import java.util.Arrays; import java.util.List; @Mixin(value = ModDiscoverer.class, @@ -28,21 +22,10 @@ public List getCandidates() { return candidates; } - @Inject(method = "findClasspathMods", - at = @At(value = "INVOKE", - target = "Lcpw/mods/fml/common/FMLLog;finer(Ljava/lang/String;[Ljava/lang/Object;)V"), - locals = LocalCapture.CAPTURE_FAILHARD, + @ModifyVariable(method = "findClasspathMods", + at = @At("STORE"), require = 1) - private void smartCheck(ModClassLoader modClassLoader, CallbackInfo ci, List knownLibraries, File[] minecraftSources, int i) { - FMLLog.fine("Found a minecraft related file at %s, examining for mod candidates", minecraftSources[i].getAbsolutePath()); - candidates.add(new ModCandidate(minecraftSources[i], minecraftSources[i], ContainerType.JAR, i == 0, true)); - } - - @Redirect(method = "findClasspathMods", - at = @At(value = "INVOKE", - target = "Lcpw/mods/fml/common/FMLLog;finer(Ljava/lang/String;[Ljava/lang/Object;)V"), - require = 1) - private void noLog(String format, Object[] data) { - + private List noKnownLibraries(List original) { + return Arrays.asList(); } }