diff options
author | Alexdoru <57050655+Alexdoru@users.noreply.github.com> | 2024-09-17 04:37:24 +0200 |
---|---|---|
committer | boubou19 <miisterunknown@gmail.com> | 2024-09-17 22:55:46 +0200 |
commit | d60ed47ae1a0131ba33e923c452123e427eedc9f (patch) | |
tree | 3ea3e812b31d2ccaadfd1dfff403fb1901b732dd /src/main/java | |
parent | 474160812a17c637378b0c59619433fddf5727fb (diff) | |
download | GT5-Unofficial-d60ed47ae1a0131ba33e923c452123e427eedc9f.tar.gz GT5-Unofficial-d60ed47ae1a0131ba33e923c452123e427eedc9f.tar.bz2 GT5-Unofficial-d60ed47ae1a0131ba33e923c452123e427eedc9f.zip |
remove reflection from GregTechAPI.constructBaseMetaTileEntity
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/gregtech/api/GregTechAPI.java | 12 |
1 files changed, 1 insertions, 11 deletions
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<BaseMetaTileEntity> sBaseMetaTileEntityClass = null; - @SuppressWarnings("unchecked") private static final IntFunction<TileEntity>[] 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); |