Closed Tommeh1 closed 7 months ago
Here is another potentially more severe example, causing a lapotronic super capacitor to freak out a few hundred times, risking that things might shutdown all over the place depending on how it behaves when it errors:
java.lang.NullPointerException: Cannot invoke "gregtech.api.interfaces.tileentity.IGregTechTileEntity.isInvalidTileEntity()" because the return value of "com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyTunnel.getBaseMetaTileEntity()" is null
at common.tileentities.GTMTE_LapotronicSuperCapacitor.onRunningTick(GTMTE_LapotronicSuperCapacitor.java:718)
at gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase.runMachine(GT_MetaTileEntity_MultiBlockBase.java:426)
at gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase.onPostTick(GT_MetaTileEntity_MultiBlockBase.java:357)
at gregtech.api.metatileentity.BaseMetaTileEntity.func_145845_h(BaseMetaTileEntity.java:522)
at net.minecraft.world.World.func_72939_s(World.java:1939)
at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:1146)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:636)
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:334)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547)
at fastcraft.u.a(F:289)
at fastcraft.H.aq(F:36)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:396)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)
Another similar issue:
java.lang.NullPointerException: Cannot read field "mStoredEnergy" because "this.mBaseMetaTileEntity" is null
at gregtech.api.metatileentity.MetaTileEntity.getEUVar(MetaTileEntity.java:537)
at com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.checkRecipe(GT_TileEntity_ElectricImplosionCompressor.java:182)
at gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase.checkRecipe(GT_MetaTileEntity_MultiBlockBase.java:416)
at gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase.runMachine(GT_MetaTileEntity_MultiBlockBase.java:473)
at gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase.onPostTick(GT_MetaTileEntity_MultiBlockBase.java:357)
at com.github.bartimaeusnek.bartworks.common.tileentities.multis.GT_TileEntity_ElectricImplosionCompressor.onPostTick(GT_TileEntity_ElectricImplosionCompressor.java:245)
at gregtech.api.metatileentity.BaseMetaTileEntity.func_145845_h(BaseMetaTileEntity.java:522)
at net.minecraft.world.World.func_72939_s(World.java:1939)
at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:1146)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:636)
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:334)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547)
at fastcraft.u.a(F:289)
at fastcraft.H.aq(F:36)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:396)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)
Yet another case:
java.lang.NullPointerException: Cannot invoke "gregtech.api.interfaces.tileentity.IGregTechTileEntity.doExplosion(long)" because the return value of "gregtech.api.metatileentity.MetaTileEntity.getBaseMetaTileEntity()" is null
at com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_computer.extraExplosions_EM(GT_MetaTileEntity_EM_computer.java:406)
at com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM.explodeMultiblock(GT_MetaTileEntity_MultiblockBase_EM.java:2111)
at com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM.doExplosion(GT_MetaTileEntity_MultiblockBase_EM.java:2153)
at gregtech.api.metatileentity.BaseMetaTileEntity.doExplosion(BaseMetaTileEntity.java:1354)
at gregtech.api.metatileentity.BaseMetaTileEntity.doEnergyExplosion(BaseMetaTileEntity.java:1315)
at gregtech.common.blocks.GT_Block_Machines.func_149690_a(GT_Block_Machines.java:518)
at net.minecraft.world.Explosion.func_77279_a(Explosion.java:212)
at net.minecraft.world.WorldServer.func_72885_a(WorldServer.java:902)
at net.minecraft.world.World.func_72876_a(World.java:2403)
at gregtech.api.metatileentity.MetaTileEntity.doExplosion(MetaTileEntity.java:1104)
at gregtech.api.metatileentity.BaseMetaTileEntity.doExplosion(BaseMetaTileEntity.java:1354)
at com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_research.extraExplosions_EM(GT_MetaTileEntity_EM_research.java:583)
at com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM.explodeMultiblock(GT_MetaTileEntity_MultiblockBase_EM.java:2111)
at com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM.doExplosion(GT_MetaTileEntity_MultiblockBase_EM.java:2153)
at gregtech.api.metatileentity.BaseMetaTileEntity.doExplosion(BaseMetaTileEntity.java:1354)
at gregtech.api.metatileentity.BaseMetaTileEntity.doEnergyExplosion(BaseMetaTileEntity.java:1315)
at gregtech.common.blocks.GT_Block_Machines.func_149690_a(GT_Block_Machines.java:518)
at net.minecraft.world.Explosion.func_77279_a(Explosion.java:212)
at net.minecraft.world.WorldServer.func_72885_a(WorldServer.java:902)
at net.minecraft.world.World.func_72876_a(World.java:2403)
at gregtech.api.metatileentity.MetaTileEntity.doExplosion(MetaTileEntity.java:1104)
at gregtech.api.metatileentity.BaseMetaTileEntity.doExplosion(BaseMetaTileEntity.java:1354)
at gregtech.api.metatileentity.BaseMetaTileEntity.doEnergyExplosion(BaseMetaTileEntity.java:1315)
at gregtech.common.blocks.GT_Block_Machines.func_149690_a(GT_Block_Machines.java:518)
at net.minecraft.world.Explosion.func_77279_a(Explosion.java:212)
at net.minecraft.world.WorldServer.func_72885_a(WorldServer.java:902)
at net.minecraft.world.World.func_72876_a(World.java:2403)
at gregtech.api.metatileentity.MetaTileEntity.doExplosion(MetaTileEntity.java:1104)
at gregtech.api.metatileentity.BaseMetaTileEntity.doExplosion(BaseMetaTileEntity.java:1354)
at com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM.explodeMultiblock(GT_MetaTileEntity_MultiblockBase_EM.java:2134)
at com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM.doExplosion(GT_MetaTileEntity_MultiblockBase_EM.java:2153)
at gregtech.api.metatileentity.BaseMetaTileEntity.doExplosion(BaseMetaTileEntity.java:1354)
at gregtech.api.metatileentity.BaseMetaTileEntity.doEnergyExplosion(BaseMetaTileEntity.java:1315)
at gregtech.common.blocks.GT_Block_Machines.func_149690_a(GT_Block_Machines.java:518)
at net.minecraft.world.Explosion.func_77279_a(Explosion.java:212)
at net.minecraft.world.WorldServer.func_72885_a(WorldServer.java:902)
at net.minecraft.world.World.func_72876_a(World.java:2403)
at gregtech.api.metatileentity.MetaTileEntity.doExplosion(MetaTileEntity.java:1104)
at gregtech.api.metatileentity.BaseMetaTileEntity.doExplosion(BaseMetaTileEntity.java:1354)
at gregtech.api.metatileentity.BaseMetaTileEntity.doEnergyExplosion(BaseMetaTileEntity.java:1315)
at gregtech.common.blocks.GT_Block_Machines.func_149690_a(GT_Block_Machines.java:518)
at net.minecraft.world.Explosion.func_77279_a(Explosion.java:212)
at net.minecraft.world.WorldServer.func_72885_a(WorldServer.java:902)
at net.minecraft.world.World.func_72876_a(World.java:2403)
at gregtech.api.metatileentity.MetaTileEntity.doExplosion(MetaTileEntity.java:1104)
at com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM.doExplosion(GT_MetaTileEntity_MultiblockBase_EM.java:2154)
at gregtech.api.metatileentity.BaseMetaTileEntity.doExplosion(BaseMetaTileEntity.java:1354)
at com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM.explodeMultiblock(GT_MetaTileEntity_MultiblockBase_EM.java:2137)
at com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM.onPostTick(GT_MetaTileEntity_MultiblockBase_EM.java:1176)
at gregtech.api.metatileentity.BaseMetaTileEntity.func_145845_h(BaseMetaTileEntity.java:522)
at net.minecraft.world.World.func_72939_s(World.java:1939)
at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:1146)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:636)
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:334)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547)
at fastcraft.u.a(F:289)
at fastcraft.H.aq(F:36)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:396)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)
And another:
java.lang.NullPointerException: Cannot read field "mStoredEnergy" because "this.mBaseMetaTileEntity" is null
at gregtech.api.metatileentity.MetaTileEntity.setEUVar(MetaTileEntity.java:544)
at com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM.onPostTick(GT_MetaTileEntity_MultiblockBase_EM.java:1203)
at gregtech.api.metatileentity.BaseMetaTileEntity.func_145845_h(BaseMetaTileEntity.java:522)
at net.minecraft.world.World.func_72939_s(World.java:1939)
at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:1146)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:636)
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:334)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547)
at fastcraft.u.a(F:289)
at fastcraft.H.aq(F:36)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:396)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)
Your GTNH Discord Username
No response
Your Pack Version
2.3.2
Your Server
Private Server
Java Version
Java 19
Type of Server
Vanilla Forge
The Reality
It turns out that the error, which can affect just about any machine as mentioned in #13143 can also cause more severe issues, for example disconnecting the client like shown below. In other cases it generally leads to random recipes failing, causing minor shortages for AE2 orders, jamming the order, or a general loss of items. Additionally it might explain a couple of random shutdowns of machines or machines using an odd power tier until restarted as power related checks are also affected.
The cause is most likely introduced in either 2.3.1 or 2.3.2 The trigger however is unknown, given that it can even cause issues with nobody online for machines that run essentially all the time.
This also ain't limited to a single mod adding machines, Gregtech, GT++, TecTech, GoodGenerator etc are all affected. There are also no limits as to what checks can end up having null returned by getBaseMetaTileEntity(), seemingly any check that needs it is affected.
Your Proposal
Fix whatever causes getBaseMetaTileEntity() on seemingly any machine to return null at random.
Final Checklist