Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.zekerzhayard.forgewrapper.installer;

import cpw.mods.modlauncher.ClassTransformer;
import java.io.File;
import java.net.URL;
import java.net.URLClassLoader;
Expand All @@ -10,7 +11,6 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;

import cpw.mods.modlauncher.Launcher;
import io.github.zekerzhayard.forgewrapper.installer.detector.DetectorLoader;
import io.github.zekerzhayard.forgewrapper.installer.detector.IFileDetector;
import io.github.zekerzhayard.forgewrapper.installer.util.ModuleUtil;
Expand Down Expand Up @@ -47,7 +47,7 @@ public static void main(String[] args) throws Throwable {

try (URLClassLoader ucl = URLClassLoader.newInstance(new URL[] {
Main.class.getProtectionDomain().getCodeSource().getLocation(),
Launcher.class.getProtectionDomain().getCodeSource().getLocation(),
ClassTransformer.class.getProtectionDomain().getCodeSource().getLocation(),
installerJar.toUri().toURL()
}, ModuleUtil.getPlatformClassLoader())) {
Class<?> installer = ucl.loadClass("io.github.zekerzhayard.forgewrapper.installer.Installer");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;

import cpw.mods.modlauncher.Launcher;
import cpw.mods.modlauncher.ClassTransformer;

public interface IFileDetector {
/**
Expand All @@ -29,7 +28,7 @@ default Path getLibraryDir() {
return Paths.get(libraryDir).toAbsolutePath();
}
try {
Path launcher = Paths.get(Launcher.class.getProtectionDomain().getCodeSource().getLocation().toURI());
Path launcher = Paths.get(ClassTransformer.class.getProtectionDomain().getCodeSource().getLocation().toURI());

while (!launcher.getFileName().toString().equals("libraries")) {
launcher = launcher.getParent();
Expand Down