From f3a1c59a77d611f6a178a76fe47acf00dabfd48b Mon Sep 17 00:00:00 2001 From: Matthew Messinger Date: Sat, 2 Apr 2016 22:56:57 -0400 Subject: [PATCH] Workaround for mixin bug --- .../minelittlepony/launch/MineLPTweaker.java | 27 +++++++++++++++++++ src/main/resources/litemod.json | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/brohoof/minelittlepony/launch/MineLPTweaker.java diff --git a/src/main/java/com/brohoof/minelittlepony/launch/MineLPTweaker.java b/src/main/java/com/brohoof/minelittlepony/launch/MineLPTweaker.java new file mode 100644 index 00000000..42ecfeb2 --- /dev/null +++ b/src/main/java/com/brohoof/minelittlepony/launch/MineLPTweaker.java @@ -0,0 +1,27 @@ +package com.brohoof.minelittlepony.launch; + +import java.io.File; +import java.util.List; + +import org.spongepowered.asm.mixin.MixinEnvironment; + +import net.minecraft.launchwrapper.ITweaker; +import net.minecraft.launchwrapper.LaunchClassLoader; + +public class MineLPTweaker implements ITweaker { + + private static final String CONFIGS[] = { "mixin.hdskins.json", "mixin.minelp.json" }; + + @Override + public void injectIntoClassLoader(LaunchClassLoader classLoader) { + for (String config : CONFIGS) { + MixinEnvironment.getDefaultEnvironment().addConfiguration(config); + } + } + + //@formatter:off + @Override public void acceptOptions(List args, File gameDir, final File assetsDir, String profile) {} + @Override public String getLaunchTarget() { return null; } + @Override public String[] getLaunchArguments() { return new String[0]; } + //@formatter:on +} diff --git a/src/main/resources/litemod.json b/src/main/resources/litemod.json index 3f3dbfc4..fa6b3010 100644 --- a/src/main/resources/litemod.json +++ b/src/main/resources/litemod.json @@ -4,7 +4,7 @@ "version": "${version}", "revision": "${revision}", "author": "Verdana, Rene_Z, Mumfrey, JoyJoy", - "mixinConfigs": [ "mixin.minelp.json", "mixin.hdskins.json" ], + "tweakClass": "com.brohoof.minelittlepony.launch.MineLPTweaker", "description": "Mine Little Pony turns players and mobs into ponies", "description.litemodminelittlepony": "Mine Little Pony turns players and mobs into ponies", "description.litemodhdskinsmod": "Seperate skin server for Mine Little Pony that also supports HD skins. Access via Skin Manager key binding (default: F1) in the main menu."