Delete more old code
This commit is contained in:
parent
7f27141a16
commit
555213714f
|
|
@ -1,26 +0,0 @@
|
||||||
package org.embeddedt.modernfix.forge.classloading;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sometimes mods have classes that circularly reference each other. If each of these classes ends up being loaded
|
|
||||||
* from two mods, a deadlock occurs.
|
|
||||||
*
|
|
||||||
* To avoid this problem we maintain a list of classes that should be loaded early and do it via Class.forName.
|
|
||||||
*/
|
|
||||||
public class ClassLoadHack {
|
|
||||||
private static final String[] classesToLoadEarly = new String[] {
|
|
||||||
"team.creative.creativecore.common.config.ConfigTypeConveration",
|
|
||||||
"team.creative.creativecore.common.util.ingredient.CreativeIngredient"
|
|
||||||
};
|
|
||||||
|
|
||||||
public static void loadModClasses() {
|
|
||||||
for(String clzName : classesToLoadEarly) {
|
|
||||||
try {
|
|
||||||
Class.forName(clzName);
|
|
||||||
} catch(Throwable e) {
|
|
||||||
if(!(e instanceof ClassNotFoundException)) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package org.embeddedt.modernfix.forge.mixin.perf.fast_registry_validation;
|
package org.embeddedt.modernfix.forge.mixin.perf.fast_registry_validation;
|
||||||
|
|
||||||
import net.minecraftforge.fml.util.ObfuscationReflectionHelper;
|
|
||||||
import net.minecraftforge.registries.ForgeRegistry;
|
import net.minecraftforge.registries.ForgeRegistry;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.apache.logging.log4j.Marker;
|
import org.apache.logging.log4j.Marker;
|
||||||
|
|
@ -10,27 +9,10 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@Mixin(value = ForgeRegistry.class, remap = false)
|
@Mixin(value = ForgeRegistry.class, remap = false)
|
||||||
public class ForgeRegistryMixin<V> {
|
public class ForgeRegistryMixin<V> {
|
||||||
private static Method bitSetTrimMethod = null;
|
|
||||||
private static boolean bitSetTrimMethodRetrieved = false;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Cache the result of findMethod instead of running it multiple times.
|
|
||||||
* Null checks are not required as the surrounding code handles it already.
|
|
||||||
*/
|
|
||||||
@Redirect(method = "validateContent", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/fml/util/ObfuscationReflectionHelper;findMethod(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;"), require = 0)
|
|
||||||
private Method skipMultipleRemap(Class<?> clz, String methodName, Class<?>[] params) {
|
|
||||||
if(!bitSetTrimMethodRetrieved) {
|
|
||||||
bitSetTrimMethodRetrieved = true;
|
|
||||||
bitSetTrimMethod = ObfuscationReflectionHelper.findMethod(clz, methodName, params);
|
|
||||||
}
|
|
||||||
return bitSetTrimMethod;
|
|
||||||
}
|
|
||||||
|
|
||||||
private int expectedNextBit = -1;
|
private int expectedNextBit = -1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
package org.embeddedt.modernfix.forge.rs;
|
|
||||||
|
|
||||||
import net.minecraftforge.fluids.capability.IFluidHandler;
|
|
||||||
|
|
||||||
public interface IFluidExternalStorageCache {
|
|
||||||
boolean initCache(IFluidHandler handler);
|
|
||||||
}
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
package org.embeddedt.modernfix.forge.rs;
|
|
||||||
|
|
||||||
import net.minecraftforge.items.IItemHandler;
|
|
||||||
|
|
||||||
public interface IItemExternalStorageCache {
|
|
||||||
boolean initCache(IItemHandler handler);
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user