ForceTrackEmitter crashes when broken
Edivad99 opened this issue ยท 0 comments
Is there an existing issue for this?
- I have searched the existing issues
Description of the Bug
ForceTrackEmitter crashes when broken after it runs out of power
To Reproduce
- Place ForceTrackEmitter and power it up
- Wait for the energy to run out
- Break the block and give this error
Or run this test:
- /test run forcetrackactive
- Wait for the energy to run out
- Break the block and give this error
Expected behavior
Don't crash
Logs & Environment
[16:21:48] [Server thread/ERROR] [minecraft/PacketUtils]: Failed to handle packet net.minecraft.network.protocol.game.ServerboundPlayerActionPacket@331eddf4, suppressing error
java.lang.IllegalStateException: trackCount must be greater than 0
at mods.railcraft.world.level.block.entity.ForceTrackEmitterBlockEntity.removeTrack(ForceTrackEmitterBlockEntity.java:168) ~[%23185!/:?] {re:classloading}
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[?:?] {}
at java.util.stream.IntPipeline$1$1.accept(IntPipeline.java:180) ~[?:?] {}
at java.util.stream.IntPipeline$4$1.accept(IntPipeline.java:246) ~[?:?] {}
at java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Streams.java:104) ~[?:?] {}
at java.util.Spliterator$OfInt.forEachRemaining(Spliterator.java:711) ~[?:?] {}
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?] {}
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?] {}
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[?:?] {}
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[?:?] {}
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?] {}
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?] {}
at mods.railcraft.world.level.block.entity.ForceTrackEmitterBlockEntity.clearTracks(ForceTrackEmitterBlockEntity.java:158) ~[%23185!/:?] {re:classloading}
at mods.railcraft.world.level.block.entity.ForceTrackEmitterBlockEntity.clearTracks(ForceTrackEmitterBlockEntity.java:139) ~[%23185!/:?] {re:classloading}
at java.util.Optional.ifPresent(Optional.java:178) ~[?:?] {}
at mods.railcraft.world.level.block.ForceTrackEmitterBlock.onRemove(ForceTrackEmitterBlock.java:197) ~[%23185!/:?] {re:classloading}
at net.minecraft.world.level.block.state.BlockBehaviour$BlockStateBase.onRemove(BlockBehaviour.java:786) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23180!/:?] {re:classloading,re:mixin}
at net.minecraft.world.level.chunk.LevelChunk.setBlockState(LevelChunk.java:240) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23180!/:?] {re:classloading}
at net.minecraft.world.level.Level.setBlock(Level.java:230) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23180!/:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.world.level.Level.setBlock(Level.java:207) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23180!/:?] {re:classloading,pl:accesstransformer:B}
at net.minecraftforge.common.extensions.IForgeBlock.onDestroyedByPlayer(IForgeBlock.java:170) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23179%23186!/:?] {re:classloading,re:mixin}
at net.minecraftforge.common.extensions.IForgeBlockState.onDestroyedByPlayer(IForgeBlockState.java:128) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23179%23186!/:?] {re:classloading}
at net.minecraft.server.level.ServerPlayerGameMode.removeBlock(ServerPlayerGameMode.java:276) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23180!/:?] {re:classloading}
at net.minecraft.server.level.ServerPlayerGameMode.destroyBlock(ServerPlayerGameMode.java:250) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23180!/:?] {re:classloading}
at net.minecraft.server.level.ServerPlayerGameMode.destroyAndAck(ServerPlayerGameMode.java:221) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23180!/:?] {re:classloading}
at net.minecraft.server.level.ServerPlayerGameMode.handleBlockBreakAction(ServerPlayerGameMode.java:148) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23180!/:?] {re:classloading}
at net.minecraft.server.network.ServerGamePacketListenerImpl.handlePlayerAction(ServerGamePacketListenerImpl.java:1052) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23180!/:?] {re:classloading}
at net.minecraft.network.protocol.game.ServerboundPlayerActionPacket.handle(ServerboundPlayerActionPacket.java:47) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23180!/:?] {re:classloading}
at net.minecraft.network.protocol.game.ServerboundPlayerActionPacket.handle(ServerboundPlayerActionPacket.java:8) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23180!/:?] {re:classloading}
at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:40) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23180!/:?] {re:classloading}
at net.minecraft.server.TickTask.run(TickTask.java:20) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23180!/:?] {re:classloading}
at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:146) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23180!/:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:22) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23180!/:?] {re:classloading}
at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:784) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23180!/:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:157) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23180!/:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:116) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23180!/:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:767) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23180!/:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:761) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23180!/:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:129) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23180!/:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:747) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23180!/:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:676) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23180!/:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:244) ~[forge-1.19.2-43.1.30_mapped_parchment_2022.09.18-1.19.2-recomp.jar%23180!/:?] {re:classloading,pl:accesstransformer:B}
at java.lang.Thread.run(Thread.java:833) [?:?] {}
[16:21:48] [Server thread/WARN] [minecraft/LevelChunk]: Block entity railcraft:force_track_emitter @ BlockPos{x=232, y=-58, z=8} state Block{minecraft:air} invalid for ticking:
Screenshots & Video
No response