mirror of
https://github.com/xfl03/MCCustomSkinLoader.git
synced 2026-11-23 21:49:38 +00:00
Fix DefaultFMLPlatform can't be loaded when other FML platform being used. (#132)
This commit is contained in:
1 parent
581a2dddea
commit
855131d1aa
5 files changed
+51
-32
No files matched your search
@@ -5,11 +5,14 @@ import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import customskinloader.Logger;
|
||||
import net.minecraft.launchwrapper.ITweaker;
|
||||
import net.minecraft.launchwrapper.Launch;
|
||||
import net.minecraft.launchwrapper.LaunchClassLoader;
|
||||
|
||||
public class ForgeTweaker implements ITweaker {
|
||||
public static Logger logger = new Logger(new File("./CustomSkinLoader/ForgePlugin.log"));
|
||||
|
||||
private final static String FML_PLATFORM_INITIALIZER = "customskinloader.forge.platform.IFMLPlatform$FMLPlatformInitializer";
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -21,6 +24,7 @@ public class ForgeTweaker implements ITweaker {
|
||||
|
||||
String exclusionName = this.getClass().getName().substring(0, this.getClass().getName().lastIndexOf("."));
|
||||
((Set<String>) field.get(Launch.classLoader)).remove(exclusionName);
|
||||
Launch.classLoader.addClassLoaderExclusion(Logger.class.getName());
|
||||
Launch.classLoader.addTransformerExclusion(exclusionName);
|
||||
Launch.classLoader.loadClass(FML_PLATFORM_INITIALIZER).getMethod("initFMLPlatform").invoke(null);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user