mirror of
https://github.com/GTMEGA/EndlessIDs.git
synced 2026-11-12 06:07:31 +00:00
more code cleanup
This commit is contained in:
2 files changed
+2
-20
No files matched your search
+2
-1
@@ -19,7 +19,7 @@ import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings({"rawtypes", "WhileLoopReplaceableByForEach", "unchecked"})
|
||||
@Mixin(Chunk.class)
|
||||
public abstract class ChunkMixin {
|
||||
@Shadow public Map chunkTileEntityMap;
|
||||
@@ -44,6 +44,7 @@ public abstract class ChunkMixin {
|
||||
* @author FalsePattern
|
||||
* @reason Direct port from dumped code
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Overwrite
|
||||
public void fillChunk(byte[] var1, int var2, int var3, boolean var4) {
|
||||
Iterator var5 = this.chunkTileEntityMap.values().iterator();
|
||||
|
||||
@@ -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