Create Crafts & Additions

Create Crafts & Additions

51M Downloads

Server crash and world unusable when adding energy cargo condition to a train and have it travel through a portal

PavlychevV opened this issue ยท 2 comments

commented

Describe the bug
When adding energy cargo condition to a train schedule for a station, that is in the other dimension, train will successfully access it if player is loading that dimension, however if there are no players, the server crashes and world becomes unloadable.

To Reproduce

  1. Build a simple train network, going through a portal.
  2. Place a few accumulators on it and a portable interface to grab the energy from them.
  3. In the nether place something, that would consume electricity.
  4. Go back to the overworld.
  5. Create a train schedule for the train to travel to the nether station and stay there UNTIL all the energy is consumed.
  6. Pass it to the blaze burner on the train and stay in the overworld.
  7. After some time, crash!

Additional context

  • Mod version: 1.19.2-20230426a
  • Forge version: 43.2.10
  • Create version: 0.5.0.i
  • Minecraft: 1.19.2 (server)

Log of crash

[12:12:56] [Server thread/ERROR] [ne.mi.ev.EventBus/EVENTBUS]: Exception caught during firing event: Cannot invoke "com.simibubi.create.content.logistics.trains.entity.CarriageContraptionEntity.getContraption()" because the return value of "com.simibubi.create.content.logistics.trains.entity.Carriage.anyAvailableEntity()" is null
        Index: 8
        Listeners:
                0: HIGH
                1: ASM: class dev.architectury.event.forge.EventHandlerImplCommon event(Lnet/minecraftforge/event/TickEvent$LevelTickEvent;)V
                2: NORMAL
                3: ASM: de.melanx.simplebackups.EventListener@35db0476 onServerTick(Lnet/minecraftforge/event/TickEvent$LevelTickEvent;)V
                4: net.minecraftforge.eventbus.EventBus$$Lambda$4090/0x00000008016164c8@62ee3b8b
                5: ASM: class com.railwayteam.railways.forge.events.CommonEventsForge onWorldTick(Lnet/minecraftforge/event/TickEvent$LevelTickEvent;)V
                6: ASM: class com.mrh0.createaddition.event.GameEvents worldTickEvent(Lnet/minecraftforge/event/TickEvent$LevelTickEvent;)V
                7: ASM: blusunrize.immersiveengineering.common.world.IEWorldGen@662add5a serverWorldTick(Lnet/minecraftforge/event/TickEvent$LevelTickEvent;)V
                8: ASM: class com.simibubi.create.events.CommonEvents onServerWorldTick(Lnet/minecraftforge/event/TickEvent$LevelTickEvent;)V
                9: ASM: blusunrize.immersiveengineering.common.EventHandler@504c9a6b onWorldTick(Lnet/minecraftforge/event/TickEvent$LevelTickEvent;)V
java.lang.NullPointerException: Cannot invoke "com.simibubi.create.content.logistics.trains.entity.CarriageContraptionEntity.getContraption()" because the return value of "com.simibubi.create.content.logistics.trains.entity.Carriage.anyAvailableEntity()" is null
        at TRANSFORMER/[email protected]/com.mrh0.createaddition.trains.schedule.condition.EnergyThresholdCondition.test(EnergyThresholdCondition.java:59)
        at TRANSFORMER/[email protected]/com.mrh0.createaddition.trains.schedule.condition.EnergyThresholdCondition.lazyTickCompletion(EnergyThresholdCondition.java:49)
        at TRANSFORMER/[email protected]/com.simibubi.create.content.logistics.trains.management.schedule.condition.LazyTickedScheduleCondition.tickCompletion(LazyTickedScheduleCondition.java:20)
        at TRANSFORMER/[email protected]/com.simibubi.create.content.logistics.trains.management.schedule.ScheduleRuntime.tickConditions(ScheduleRuntime.java:157)
        at TRANSFORMER/[email protected]/com.simibubi.create.content.logistics.trains.management.schedule.ScheduleRuntime.tick(ScheduleRuntime.java:121)
        at TRANSFORMER/[email protected]/com.simibubi.create.content.logistics.trains.entity.Train.tick(Train.java:268)
        at TRANSFORMER/[email protected]/com.simibubi.create.content.logistics.trains.GlobalRailwayManager.tickTrains(GlobalRailwayManager.java:223)
        at TRANSFORMER/[email protected]/com.simibubi.create.content.logistics.trains.GlobalRailwayManager.tick(GlobalRailwayManager.java:197)
        at TRANSFORMER/[email protected]/com.simibubi.create.events.CommonEvents.onServerWorldTick(CommonEvents.java:100)
        at TRANSFORMER/[email protected]/com.simibubi.create.events.__CommonEvents_onServerWorldTick_LevelTickEvent.invoke(.dynamic)
        at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73)
        at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.EventBus.post(EventBus.java:315)
        at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.EventBus.post(EventBus.java:296)
        at TRANSFORMER/[email protected]/net.minecraftforge.event.ForgeEventFactory.onPostLevelTick(ForgeEventFactory.java:820)
        at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_5703_(MinecraftServer.java:872)
        at TRANSFORMER/[email protected]/net.minecraft.server.dedicated.DedicatedServer.m_5703_(DedicatedServer.java:292)
        at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_5705_(MinecraftServer.java:806)
        at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:654)
        at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:244)
        at java.base/java.lang.Thread.run(Thread.java:833)

[12:12:56] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception
java.lang.NullPointerException: Cannot invoke "com.simibubi.create.content.logistics.trains.entity.CarriageContraptionEntity.getContraption()" because the return value of "com.simibubi.create.content.logistics.trains.entity.Carriage.anyAvailableEntity()" is null
        at com.mrh0.createaddition.trains.schedule.condition.EnergyThresholdCondition.test(EnergyThresholdCondition.java:59) ~[createaddition-1.19.2-20230426a.jar%23149!/:1.19.2-20230426a] {re:classloading,pl:runtimedistcleaner:A}
        at com.mrh0.createaddition.trains.schedule.condition.EnergyThresholdCondition.lazyTickCompletion(EnergyThresholdCondition.java:49) ~[createaddition-1.19.2-20230426a.jar%23149!/:1.19.2-20230426a] {re:classloading,pl:runtimedistcleaner:A}
        at com.simibubi.create.content.logistics.trains.management.schedule.condition.LazyTickedScheduleCondition.tickCompletion(LazyTickedScheduleCondition.java:20) ~[create-1.19.2-0.5.0.i.jar%23141!/:0.5.0.i] {re:classloading}
        at com.simibubi.create.content.logistics.trains.management.schedule.ScheduleRuntime.tickConditions(ScheduleRuntime.java:157) ~[create-1.19.2-0.5.0.i.jar%23141!/:0.5.0.i] {re:mixin,re:classloading,pl:mixin:APP:railways-common.mixins.json:AccessorScheduleRuntime,pl:mixin:APP:railways-common.mixins.json:MixinScheduleRuntime,pl:mixin:A}
        at com.simibubi.create.content.logistics.trains.management.schedule.ScheduleRuntime.tick(ScheduleRuntime.java:121) ~[create-1.19.2-0.5.0.i.jar%23141!/:0.5.0.i] {re:mixin,re:classloading,pl:mixin:APP:railways-common.mixins.json:AccessorScheduleRuntime,pl:mixin:APP:railways-common.mixins.json:MixinScheduleRuntime,pl:mixin:A}
        at com.simibubi.create.content.logistics.trains.entity.Train.tick(Train.java:268) ~[create-1.19.2-0.5.0.i.jar%23141!/:0.5.0.i] {re:mixin,re:classloading,pl:mixin:APP:railways-common.mixins.json:AccessorTrain,pl:mixin:APP:railways-common.mixins.json:MixinTrain,pl:mixin:A}
        at com.simibubi.create.content.logistics.trains.GlobalRailwayManager.tickTrains(GlobalRailwayManager.java:223) ~[create-1.19.2-0.5.0.i.jar%23141!/:0.5.0.i] {re:classloading,pl:runtimedistcleaner:A,re:mixin,pl:runtimedistcleaner:A}
        at com.simibubi.create.content.logistics.trains.GlobalRailwayManager.tick(GlobalRailwayManager.java:197) ~[create-1.19.2-0.5.0.i.jar%23141!/:0.5.0.i] {re:classloading,pl:runtimedistcleaner:A,re:mixin,pl:runtimedistcleaner:A}
        at com.simibubi.create.events.CommonEvents.onServerWorldTick(CommonEvents.java:100) ~[create-1.19.2-0.5.0.i.jar%23141!/:0.5.0.i] {re:classloading}
        at com.simibubi.create.events.__CommonEvents_onServerWorldTick_LevelTickEvent.invoke(.dynamic) ~[create-1.19.2-0.5.0.i.jar%23141!/:0.5.0.i] {re:classloading,pl:eventbus:B}
        at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73) ~[eventbus-6.0.3.jar%2351!/:?] {}
        at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.3.jar%2351!/:?] {}
        at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.3.jar%2351!/:?] {}
        at net.minecraftforge.event.ForgeEventFactory.onPostLevelTick(ForgeEventFactory.java:820) ~[forge-1.19.2-43.2.10-universal.jar%23178!/:?] {re:classloading}
        at net.minecraft.server.MinecraftServer.m_5703_(MinecraftServer.java:872) ~[server-1.19.2-20220805.130853-srg.jar%23173!/:?] {re:classloading,pl:accesstransformer:B}
        at net.minecraft.server.dedicated.DedicatedServer.m_5703_(DedicatedServer.java:292) ~[server-1.19.2-20220805.130853-srg.jar%23173!/:?] {re:classloading,pl:accesstransformer:B}
        at net.minecraft.server.MinecraftServer.m_5705_(MinecraftServer.java:806) ~[server-1.19.2-20220805.130853-srg.jar%23173!/:?] {re:classloading,pl:accesstransformer:B}
        at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:654) ~[server-1.19.2-20220805.130853-srg.jar%23173!/:?] {re:classloading,pl:accesstransformer:B}
        at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:244) ~[server-1.19.2-20220805.130853-srg.jar%23173!/:?] {re:classloading,pl:accesstransformer:B}
        at java.lang.Thread.run(Thread.java:833) [?:?] {}

Thank you!

commented

Should be fixed in 20230507a.

commented

It is, thank you!