Fix Optifine not running in dev environment
For some reason loading the net.minecraft.client.ClientBrandRetriever class causes mixin issues
This commit is contained in:
+14
-23
@@ -1,6 +1,5 @@
|
||||
package com.seibel.distanthorizons.neoforge.mixins;
|
||||
|
||||
import net.minecraft.client.ClientBrandRetriever;
|
||||
import net.neoforged.fml.ModList;
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
|
||||
@@ -15,12 +14,16 @@ import java.util.Set;
|
||||
*/
|
||||
public class NeoforgeMixinPlugin implements IMixinConfigPlugin
|
||||
{
|
||||
private boolean isNeoforgeMixinFile = false;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldApplyMixin(String targetClassName, String mixinClassName)
|
||||
{
|
||||
if (!ClientBrandRetriever.getClientModName().equals("neoforge"))
|
||||
if (!this.isNeoforgeMixinFile)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mixinClassName.contains(".mods."))
|
||||
{ // If the mixin wants to go into a mod then we check if that mod is loaded or not
|
||||
@@ -32,6 +35,7 @@ public class NeoforgeMixinPlugin implements IMixinConfigPlugin
|
||||
.replaceAll("\\..*$", "") // Replaces everything after the mod name
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -39,37 +43,24 @@ public class NeoforgeMixinPlugin implements IMixinConfigPlugin
|
||||
@Override
|
||||
public void onLoad(String mixinPackage)
|
||||
{
|
||||
|
||||
// prevents running forge mixins
|
||||
// example string: com.seibel.distanthorizons.neoforge.mixins
|
||||
this.isNeoforgeMixinFile = mixinPackage.contains("neo");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRefMapperConfig()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
public String getRefMapperConfig() { return null; }
|
||||
|
||||
@Override
|
||||
public void acceptTargets(Set<String> myTargets, Set<String> otherTargets)
|
||||
{
|
||||
|
||||
}
|
||||
public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) { }
|
||||
|
||||
@Override
|
||||
public List<String> getMixins()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
public List<String> getMixins() { return null; }
|
||||
|
||||
@Override
|
||||
public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo)
|
||||
{
|
||||
|
||||
}
|
||||
public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { }
|
||||
|
||||
@Override
|
||||
public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo)
|
||||
{
|
||||
|
||||
}
|
||||
public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { }
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user