aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexdoru <57050655+Alexdoru@users.noreply.github.com>2024-09-17 04:37:24 +0200
committerboubou19 <miisterunknown@gmail.com>2024-09-17 22:55:46 +0200
commitd60ed47ae1a0131ba33e923c452123e427eedc9f (patch)
tree3ea3e812b31d2ccaadfd1dfff403fb1901b732dd /src
parent474160812a17c637378b0c59619433fddf5727fb (diff)
downloadGT5-Unofficial-d60ed47ae1a0131ba33e923c452123e427eedc9f.tar.gz
GT5-Unofficial-d60ed47ae1a0131ba33e923c452123e427eedc9f.tar.bz2
GT5-Unofficial-d60ed47ae1a0131ba33e923c452123e427eedc9f.zip
remove reflection from GregTechAPI.constructBaseMetaTileEntity
Diffstat (limited to 'src')
-rw-r--r--src/main/java/gregtech/api/GregTechAPI.java12
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);