Applied Energistics 2

Applied Energistics 2

156M Downloads

Energy Cell Crash on Grid Changes

shartte opened this issue ยท 0 comments

commented

Test Setup:

image

Applies to both Forge 1.16.1 and Fabric 1.16.2.

This can occur when placing/breaking or just inserting cells into the grid.

Example stack trace Fabric:

java.lang.NullPointerException: Ticking block entity
	at appeng.tile.networking.EnergyCellBlockEntity.injectAEPower(EnergyCellBlockEntity.java:143)
	at appeng.me.cache.EnergyGridCache.injectProviderPower(EnergyGridCache.java:341)
	at appeng.me.cache.EnergyGridCache.injectPower(EnergyGridCache.java:402)
	at appeng.tile.networking.EnergyAcceptorBlockEntity.funnelPowerIntoStorage(EnergyAcceptorBlockEntity.java:63)
	at appeng.tile.powersink.AEBasePoweredBlockEntity.injectExternalPower(AEBasePoweredBlockEntity.java:101)
	at appeng.tile.powersink.AEBasePoweredBlockEntity.setStored(AEBasePoweredBlockEntity.java:254)
	at team.reborn.energy.EnergyHandler.insert(EnergyHandler.java:59)
	at team.reborn.energy.EnergyMovement.move(EnergyMovement.java:48)
	at team.reborn.energy.EnergyMovement.move(EnergyMovement.java:25)
	at techreborn.blockentity.cable.CableBlockEntity.lambda$tick$0(CableBlockEntity.java:182)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at techreborn.blockentity.cable.CableBlockEntity.method_16896(CableBlockEntity.java:179)
	at net.minecraft.class_1937.method_18471(class_1937.java:510)
	at net.minecraft.class_3218.method_18765(class_3218.java:424)
	at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:868)
	at net.minecraft.class_3176.method_3813(class_3176.java:303)
	at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:808)
	at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:667)
	at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:254)
	at java.base/java.lang.Thread.run(Thread.java:832)

Example stack trace Forge (simply when placing a cell closes the gap):

[13:35:19] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception
net.minecraft.crash.ReportedException: Ticking block entity
	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:890) ~[?:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:822) ~[?:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:87) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:665) ~[?:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.lambda$func_240784_a_$0(MinecraftServer.java:231) ~[?:?] {re:classloading,pl:accesstransformer:B}
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121] {}
Caused by: java.lang.NullPointerException
	at appeng.tile.networking.EnergyCellTileEntity.injectAEPower(EnergyCellTileEntity.java:143) ~[?:?] {re:classloading}
	at appeng.me.cache.EnergyGridCache.injectProviderPower(EnergyGridCache.java:341) ~[?:?] {re:classloading}
	at appeng.me.cache.EnergyGridCache.injectPower(EnergyGridCache.java:402) ~[?:?] {re:classloading}
	at appeng.tile.networking.EnergyAcceptorTileEntity.funnelPowerIntoStorage(EnergyAcceptorTileEntity.java:62) ~[?:?] {re:classloading}
	at appeng.tile.powersink.AEBasePoweredTileEntity.injectExternalPower(AEBasePoweredTileEntity.java:106) ~[?:?] {re:classloading}
	at appeng.tile.powersink.ForgeEnergyAdapter.receiveEnergy(ForgeEnergyAdapter.java:23) ~[?:?] {re:classloading}
	at appeng.debug.EnergyGeneratorTileEntity.lambda$tick$0(EnergyGeneratorTileEntity.java:75) ~[?:?] {re:classloading}
	at net.minecraftforge.common.util.LazyOptional.ifPresent(LazyOptional.java:161) ~[?:?] {re:classloading}
	at appeng.debug.EnergyGeneratorTileEntity.tick(EnergyGeneratorTileEntity.java:73) ~[?:?] {re:classloading}
	at net.minecraft.world.World.tickBlockEntities(World.java:580) ~[?:?] {re:classloading,pl:accesstransformer:B,re:mixin,pl:accesstransformer:B}
	at net.minecraft.world.server.ServerWorld.tick(ServerWorld.java:367) ~[?:?] {re:classloading,re:mixin}
	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:886) ~[?:?] {re:classloading,pl:accesstransformer:B}
	... 5 more