mirror of
https://github.com/LegacyModdingMC/UniMix.git
synced 2026-11-20 12:19:52 +00:00
Clean this up, correct version
This commit is contained in:
1 parent
adf1c040a6
commit
f0d25bd299
3 files changed
+6
-44
No files matched your search
@@ -24,16 +24,13 @@
|
||||
*/
|
||||
package org.spongepowered.asm.launch;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.spongepowered.asm.launch.platform.MixinPlatformManager;
|
||||
import org.spongepowered.asm.mixin.MixinEnvironment;
|
||||
import org.spongepowered.asm.mixin.MixinEnvironment.Phase;
|
||||
import org.spongepowered.asm.util.PrettyPrinter;
|
||||
|
||||
import net.minecraft.launchwrapper.Launch;
|
||||
import net.minecraft.launchwrapper.LaunchClassLoader;
|
||||
@@ -65,7 +62,7 @@ public abstract class MixinBootstrap {
|
||||
/**
|
||||
* Subsystem version
|
||||
*/
|
||||
public static final String VERSION = "0.6";
|
||||
public static final String VERSION = "0.5.11";
|
||||
|
||||
// Consts
|
||||
private static final String LAUNCH_PACKAGE = "org.spongepowered.asm.launch.";
|
||||
@@ -170,10 +167,11 @@ public abstract class MixinBootstrap {
|
||||
throw new IllegalStateException("MixinBootstrap.doInit() called before MixinBootstrap.preInit()");
|
||||
}
|
||||
|
||||
for (String platformProviderClass : MixinBootstrap.getPlatform().getPhaseProviderClasses()) {
|
||||
MixinBootstrap.getPlatform().getPhaseProviderClasses();
|
||||
// for (String platformProviderClass : MixinBootstrap.getPlatform().getPhaseProviderClasses()) {
|
||||
// System.err.printf("Registering %s\n", platformProviderClass);
|
||||
// MixinEnvironment.registerPhaseProvider(platformProviderClass);
|
||||
}
|
||||
// }
|
||||
|
||||
if (MixinBootstrap.initState) {
|
||||
MixinBootstrap.getPlatform().prepare(args);
|
||||
|
||||
@@ -224,6 +224,7 @@ public class MixinPlatformManager {
|
||||
*
|
||||
* @param level compatibility level as a string
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
final void setCompatibilityLevel(String level) {
|
||||
try {
|
||||
CompatibilityLevel value = CompatibilityLevel.valueOf(level.toUpperCase());
|
||||
@@ -242,6 +243,7 @@ public class MixinPlatformManager {
|
||||
*
|
||||
* @param config config resource name, does not require a leading /
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
final void addConfig(String config) {
|
||||
if (config.endsWith(".json")) {
|
||||
MixinPlatformManager.logger.debug("Registering mixin config: {}", config);
|
||||
|
||||
@@ -30,7 +30,6 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Vector;
|
||||
|
||||
import net.minecraft.launchwrapper.LaunchClassLoader;
|
||||
|
||||
@@ -42,15 +41,6 @@ import net.minecraft.launchwrapper.LaunchClassLoader;
|
||||
*/
|
||||
public final class LaunchClassLoaderUtil {
|
||||
|
||||
/**
|
||||
* Class load state
|
||||
*/
|
||||
public enum LoadedType {
|
||||
UNLOADED,
|
||||
LOADED,
|
||||
TRANSFORMED
|
||||
}
|
||||
|
||||
/**
|
||||
* ClassLoader -> util mapping
|
||||
*/
|
||||
@@ -61,8 +51,6 @@ public final class LaunchClassLoaderUtil {
|
||||
*/
|
||||
private final LaunchClassLoader classLoader;
|
||||
|
||||
private final Set<String> parentLoadedClassNames = new HashSet<String>();
|
||||
|
||||
// Reflected fields
|
||||
private Map<String, Class<?>> cachedClasses;
|
||||
private final Set<String> invalidClasses;
|
||||
@@ -125,12 +113,6 @@ public final class LaunchClassLoaderUtil {
|
||||
return true;
|
||||
}
|
||||
|
||||
// if (this.parentLoadedClassNames.contains(name)) {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// this.readLoadedClassesFromParent();
|
||||
// return this.parentLoadedClassNames.contains(name);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -185,26 +167,6 @@ public final class LaunchClassLoaderUtil {
|
||||
return Collections.<String>emptySet();
|
||||
}
|
||||
|
||||
private void readLoadedClassesFromParent() {
|
||||
if (this.classLoader == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
ClassLoader parent = this.classLoader.getClass().getClassLoader();
|
||||
try {
|
||||
Field fdClasses = ClassLoader.class.getDeclaredField("classes");
|
||||
fdClasses.setAccessible(true);
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Vector<Class<?>> classes = (Vector<Class<?>>) fdClasses.get(parent);
|
||||
for (Class<?> c : classes) {
|
||||
this.parentLoadedClassNames.add(c.getName());
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
// boo
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private static <T> T getField(LaunchClassLoader classLoader, String fieldName) {
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user