Skip to content

Commit

Permalink
Move MixinExtras init earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
embeddedt committed May 27, 2024
1 parent a5f16c2 commit 3608b07
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableListMultimap;
import com.google.common.collect.ImmutableMap;
import com.llamalad7.mixinextras.MixinExtrasBootstrap;
import net.minecraft.launchwrapper.Launch;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Loader;
Expand Down Expand Up @@ -99,7 +98,6 @@ private static void writeOrderedProperties(Properties props, OutputStream stream
@Override
public void onLoad(String s) {
if(allMixins.size() == 0) {
MixinExtrasBootstrap.init();
try {
URI uri = Objects.requireNonNull(MixinConfigPlugin.class.getResource("/mixins.vintagefix.json")).toURI();
FileSystem fs;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package org.embeddedt.vintagefix.core;

import com.llamalad7.mixinextras.MixinExtrasBootstrap;
import org.objectweb.asm.tree.ClassNode;
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;

import java.util.Collections;
import java.util.List;
import java.util.Set;

public class MixinExtrasBootstrapPlugin implements IMixinConfigPlugin {
@Override
public void onLoad(String s) {
MixinExtrasBootstrap.init();
}

@Override
public String getRefMapperConfig() {
return "";
}

@Override
public boolean shouldApplyMixin(String s, String s1) {
return false;
}

@Override
public void acceptTargets(Set<String> set, Set<String> set1) {

}

@Override
public List<String> getMixins() {
return Collections.emptyList();
}

@Override
public void preApply(String s, ClassNode classNode, String s1, IMixinInfo iMixinInfo) {

}

@Override
public void postApply(String s, ClassNode classNode, String s1, IMixinInfo iMixinInfo) {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,6 @@ public List<String> getMixinConfigs() {
applyMixinFix();
mixinFixApplied = true;
}
return ImmutableList.of("mixins.vintagefix.json");
return ImmutableList.of("mixins.vintagefix.init.json", "mixins.vintagefix.json");
}
}
18 changes: 18 additions & 0 deletions src/main/resources/mixins.vintagefix.init.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"required": true,
"minVersion": "0.8",
"package": "org.embeddedt.vintagefix.mixin",
"plugin": "org.embeddedt.vintagefix.core.MixinExtrasBootstrapPlugin",
"target": "@env(INIT)",
"compatibilityLevel": "JAVA_8",
"mixins": [
],
"client": [
],
"overwrites": {
"conformVisibility": true
},
"injectors": {
"defaultRequire": 1
}
}

0 comments on commit 3608b07

Please sign in to comment.