mirror of
https://github.com/GTMEGA/EndlessIDs.git
synced 2026-11-21 18:32:20 +00:00
more code cleanup
This commit is contained in:
2 files changed
+2
-20
No files matched your search
@@ -1,17 +1,13 @@
|
||||
package com.falsepattern.endlessids.mixin.plugin;
|
||||
|
||||
import com.google.common.io.Files;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.ModClassLoader;
|
||||
import net.minecraft.launchwrapper.Launch;
|
||||
import net.minecraft.launchwrapper.LaunchClassLoader;
|
||||
import sun.misc.URLClassPath;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.nio.file.Path;
|
||||
|
||||
/**
|
||||
* Backport from spongemixins 1.3
|
||||
*/
|
||||
@@ -51,21 +47,6 @@ public final class MinecraftURLClassPath {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a jar within the minecraft mods directory
|
||||
*/
|
||||
public static File getJarInModPath(final String jarname) {
|
||||
try {
|
||||
return java.nio.file.Files.walk(new File(Launch.minecraftHome, "mods/").toPath()).filter( p -> {
|
||||
final String filename = p.toString();
|
||||
return Files.getNameWithoutExtension(filename).contains(jarname) && Files.getFileExtension(filename).equals("jar");
|
||||
}).map(Path::toFile).findFirst().orElse(null);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a Jar to the Minecraft URL ClassPath
|
||||
* - Needed when using mixins on classes outside of Minecraft or other coremods
|
||||
|
||||
Reference in new issue
Block a user