i reckon....
This commit is contained in:
parent
6ad6792384
commit
436b301378
3 changed files with 13 additions and 3 deletions
|
@ -39,7 +39,7 @@ public class Loader implements Util {
|
|||
public static Class<?> baseBandClass;
|
||||
|
||||
public enum Response {
|
||||
OK("OK."),
|
||||
OK("Auth OK."),
|
||||
FORBIDDEN("Request Forbidden."),
|
||||
OUTDATED("Your Loader is Outdated."),
|
||||
BANNED("Account Banned."),
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
package de.com.baseband.launcher;
|
||||
|
||||
import de.com.baseband.launcher.util.Util;
|
||||
import net.minecraft.launchwrapper.ITweaker;
|
||||
import net.minecraft.launchwrapper.LaunchClassLoader;
|
||||
import net.minecraftforge.common.ForgeVersion;
|
||||
|
@ -21,7 +22,7 @@ import java.util.Map;
|
|||
@SuppressWarnings("unused")
|
||||
@IFMLLoadingPlugin.Name("baseband")
|
||||
@IFMLLoadingPlugin.MCVersion(ForgeVersion.mcVersion)
|
||||
public class Tweaker implements ITweaker, IFMLLoadingPlugin {
|
||||
public class Tweaker implements ITweaker, IFMLLoadingPlugin, Util {
|
||||
|
||||
public static void loaded(Class<?> baseBandClass) {
|
||||
Loader.loaded(baseBandClass);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package de.com.baseband.launcher.classloader;
|
||||
|
||||
import de.com.baseband.launcher.url.ByteURLHandler;
|
||||
import de.com.baseband.launcher.url.ResourceConnection;
|
||||
import de.com.baseband.launcher.url.URLWrapper;
|
||||
import de.com.baseband.launcher.util.Util;
|
||||
import de.tudbut.parsing.TCN;
|
||||
|
@ -29,17 +31,24 @@ public class CustomClassLoader extends ClassLoader implements Util {
|
|||
private final DataKeeper<PermissionManager> mixinPermissionManager;
|
||||
|
||||
static {
|
||||
|
||||
try {
|
||||
Method m = Arrays.stream(Class.forName("java.lang.ClassLoader").getDeclaredClasses()).filter(x -> x.getSimpleName().equalsIgnoreCase("ParallelLoaders")).findFirst().get().getDeclaredMethod("register", Class.class);
|
||||
m.setAccessible(true);
|
||||
m.invoke(null, CustomClassLoader.class);
|
||||
LOGGER.info("Patched ClassLoader.");
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("unable to patch ClassLoader", e);
|
||||
}
|
||||
}
|
||||
|
||||
public CustomClassLoader(Map<String, byte[]> data) {
|
||||
AccessKiller.killReflectionFor(CustomClassLoader.class, CustomMixinServer.class);
|
||||
AccessKiller.killReflectionFor(
|
||||
CustomClassLoader.class,
|
||||
CustomMixinServer.class,
|
||||
URLWrapper.class,
|
||||
ByteURLHandler.class,
|
||||
ResourceConnection.class);
|
||||
|
||||
names.addAll(data.keySet());
|
||||
this.binaryKeeper = new DataKeeper<>(
|
||||
|
|
Loading…
Add table
Reference in a new issue