From d60ed47ae1a0131ba33e923c452123e427eedc9f Mon Sep 17 00:00:00 2001 From: Alexdoru <57050655+Alexdoru@users.noreply.github.com> Date: Tue, 17 Sep 2024 04:37:24 +0200 Subject: remove reflection from GregTechAPI.constructBaseMetaTileEntity --- src/main/java/gregtech/api/GregTechAPI.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src') diff --git a/src/main/java/gregtech/api/GregTechAPI.java b/src/main/java/gregtech/api/GregTechAPI.java index c485c8e47e..70d1a0c2ce 100644 --- a/src/main/java/gregtech/api/GregTechAPI.java +++ b/src/main/java/gregtech/api/GregTechAPI.java @@ -268,8 +268,6 @@ public class GregTechAPI { sLoadStarted = false, sLoadFinished = false, sPostloadStarted = false, sPostloadFinished = false, sFullLoadFinished = false; - private static Class sBaseMetaTileEntityClass = null; - @SuppressWarnings("unchecked") private static final IntFunction[] teCreators = new IntFunction[16]; @@ -390,16 +388,8 @@ public class GregTechAPI { * Electricity) we have to use invocation at the constructor of the BaseMetaTileEntity. */ public static BaseMetaTileEntity constructBaseMetaTileEntity() { - if (sBaseMetaTileEntityClass == null) { - try { - return (sBaseMetaTileEntityClass = BaseMetaTileEntity.class).getDeclaredConstructor() - .newInstance(); - } catch (Throwable ignored) {} - } - try { - return sBaseMetaTileEntityClass.getDeclaredConstructor() - .newInstance(); + return new BaseMetaTileEntity(); } catch (Throwable e) { GTLog.err.println("GTMod: Fatal Error occurred while initializing TileEntities, crashing Minecraft."); e.printStackTrace(GTLog.err); -- cgit