Skip to content

Commit

Permalink
implement early mixin loader interface correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
rfresh2 committed Oct 5, 2024
1 parent bdb386a commit 66d1d57
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 13 deletions.
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,15 @@ shadowJar {
manifest {
attributes([
'Manifest-Version': 1.1,
'FMLCorePluginContainsFMLMod': 'true',
'FMLCorePlugin': 'xaeroplus.mixin.MixinLoaderForge',
'ForceLoadAsMod': 'true',
"Specification-Title": "XaeroPlus",
"Specification-Vendor": "rfresh2",
"Specification-Version": "1",
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"rfresh",
"Implementation-Vendor" :"rfresh2",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
Expand Down
42 changes: 30 additions & 12 deletions src/main/java/xaeroplus/mixin/MixinLoaderForge.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
package xaeroplus.mixin;

import net.minecraftforge.fml.relauncher.FMLLaunchHandler;
import org.spongepowered.asm.launch.MixinBootstrap;
import org.spongepowered.asm.mixin.MixinEnvironment;
import org.spongepowered.asm.mixin.Mixins;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
import zone.rong.mixinbooter.IEarlyMixinLoader;
import zone.rong.mixinbooter.MixinLoader;

import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@MixinLoader
public class MixinLoaderForge implements IEarlyMixinLoader {
public class MixinLoaderForge implements IEarlyMixinLoader, IFMLLoadingPlugin {

public MixinLoaderForge() {
MixinBootstrap.init();
if (FMLLaunchHandler.isDeobfuscatedEnvironment()) {
Mixins.addConfigurations("mixins.baritone.json");
}
Mixins.addConfigurations("mixins.xaeroplus.json");
MixinEnvironment.getDefaultEnvironment().setObfuscationContext("searge");
}

@Override
Expand All @@ -31,4 +23,30 @@ public List<String> getMixinConfigs() {
}
return list;
}

@Override
public String[] getASMTransformerClass() {
return new String[0];
}

@Override
public String getModContainerClass() {
return null;
}

@Nullable
@Override
public String getSetupClass() {
return null;
}

@Override
public void injectData(final Map<String, Object> data) {

}

@Override
public String getAccessTransformerClass() {
return null;
}
}

0 comments on commit 66d1d57

Please sign in to comment.