Modern Industrialization

Modern Industrialization

4M Downloads

CTD On World Load

Skid-Inc opened this issue ยท 6 comments

commented

This issue could be an interaction between Modern-Industrialization and the Lifts mod so I have put this issue in both repositories in this event.
Ref: lucaargolo/lifts#22

I was running a creative world to test a few things as part of the All The Fabric 4 (v 0.0.9) pack, there was not much in the world but the setup I had was, a creative tank filled with steam, hooked up to a LV steam turbine, connected via copper cables to a LV Storage unit, connected to the Tech Reborn Blast Furnace. This was all working fine and then I started testing Lifts, I ended up with 2 MK 5 lifts, with a 25 block platform, with the lifts being powered by the more copper cable to the existing network.
This worked fine, then I logged out. When I logged back in the game now always crashes to desktop with the following error:

Caused by: java.lang.IllegalArgumentException: May not extract < 0 energy.
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122) ~[guava-21.0.jar:?]
	at aztech.modern_industrialization.machines.components.EnergyComponent$2.extractEnergy(EnergyComponent.java:118) ~[Modern-Industrialization-0.5.8.jar:?]
	at aztech.modern_industrialization.pipes.electricity.ElectricityNetwork.transferForTargets(ElectricityNetwork.java:102) ~[Modern-Industrialization-0.5.8.jar:?]
	at aztech.modern_industrialization.pipes.electricity.ElectricityNetwork.tick(ElectricityNetwork.java:73) ~[Modern-Industrialization-0.5.8.jar:?]
	at aztech.modern_industrialization.pipes.api.PipeNetworkNode.tick(PipeNetworkNode.java:71) ~[Modern-Industrialization-0.5.8.jar:?]
	at aztech.modern_industrialization.pipes.impl.PipeBlockEntity.tick(PipeBlockEntity.java:283) ~[Modern-Industrialization-0.5.8.jar:?]
	at aztech.modern_industrialization.api.TickableBlock.lambda$getTicker$0(TickableBlock.java:40) ~[Modern-Industrialization-0.5.8.jar:?]
	at net.minecraft.class_2818$class_5563.method_31703(class_2818.java:886) ~[intermediary-1.17.1.jar:?]
	at net.minecraft.class_2818$class_5564.method_31703(class_2818.java:941) ~[intermediary-1.17.1.jar:?]
	at net.minecraft.class_1937.method_18471(class_1937.java:474) ~[intermediary-1.17.1.jar:?]
	at net.minecraft.class_3218.method_18765(class_3218.java:422) ~[intermediary-1.17.1.jar:?]
	at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:891) ~[intermediary-1.17.1.jar:?]

Full logs here: https://pastebin.com/zBcmp7CX

When I logged out it is highly likely both the steam generator and the battery would be empty, so I don't know if this is an issue caused by Lifts specifically trying to draw power that doesn't exist, or if Modern-Industrialization is having an issue with starting up while a energy network that is asking for power but the generator hasn't be loaded in yet so has no power.

commented

Forgot to attach the crash log itself.
https://pastebin.com/t3gY19hM

commented

I can semi reliably create this issue, I've used the following build in the attached video 3 times, including the NE orientation, and all 3 times it crashes when I reload the world.
Video: https://youtu.be/cV_b7BjsdUM
Log: https://pastebin.com/nrSiGPB0
Crash Log: https://pastebin.com/Z0eeDW49

commented

Hi, can you try again with MI version 0.5.12 please? You should see a warning in the logs if it happens again, but no crash!

commented

I can not recreate the issue anymore, new worlds with this setup do now throw a warning on load. It does however still process that negative energy amount, basically voiding the lifts energy tank on load, which is less then ideal but might be an API issue, or something that should be handled on Lifts side.

[13:20:14] [Server thread/WARN]: Tried inserting up to 0 energy, but broken EnergyIo dev.technici4n.fasttransferlib.impl.energy.compat.TrWrappedEnergyHandler@49b5ebc8 inserted a negative amount of energy -6344.

Full Log: https://pastebin.com/1ZUegCuR

Existing worlds that had this problem still CTD with the old error even with 0.5.12. That said, all my existing worlds with this problem are test worlds, any live worlds we managed to recover by a nasty combination of Amulet to delete the block, then NTBExplorer to restore the original tile entity data (Amulet doesn't play nice with modded tile entities) then remove the cable tile entities, otherwise the client would null pointer because the block couldn't find the tile entity.
Crash Log: https://pastebin.com/iqg5g0xX

So I leave it up to you if you consider the problem resolved.

commented

It's probably a consequence of lifts having an energy amount > than their capacity, which causes the remaining space (capacity - amount) to be negative. I consider this resolved on MI's side. The energy API is about to change so this issue might be resolved on the lift side as well in a few weeks.

commented

In any case, thanks for reporting the crash! :)