IC2 ENet Bug 1.12

  • Hey,


    since I can remember playing modded Minecraft I used IC2. I even started to learn programming to make mods. In 2018 I joined a Modded Minecraft Network to be a developer and we faced a problem.


    In 1.12 if you unload Worlds and load it again, a weird Bug happens, where the cables disconnect from the machines and through that, you couldn't use the machines, even if you put them next to each other.

    Our team then looked up the Bug Tracker and found out that several people already reported this specific Bug:

    https://bt.industrial-craft.net/view.php?id=2490

    https://bt.industrial-craft.net/view.php?id=2653

    https://bt.industrial-craft.net/view.php?id=2653

    https://bt.industrial-craft.net/view.php?id=2714


    Like you can see these Bugs happen on normal Forge Servers or Sponge Servers.

    We also found several Logs of IC2 when loading up the world(happens in every mod pack):

    https://pastebin.com/xQsT338i


    Sometimes you can fix the bug then these log messages come:

    https://pastebin.com/0GrC9nzh


    Through further testing we found out that the machines work if they get energy inside(e.g. RE-Battery), but just do not accept any Energy from outside.

    Now you are thinking why I am not writing this in the Bug Tracker. The thing is that the last interaction of any staff member of IC2 was in February of 2019, although the bug is very gamebreaking and leads to players almost never using the mod.


    We managed to make a workaround until Version industrialcraft-2-2.8.170-ex112, where we just naturally unloaded the world(e.g. waiting in our spawn world until the affected world unloads) or using Mods where Worlds are not unloaded at all like Compact Machines(The Bug still happens here but way less frequently). In all Versions higher than industrialcraft-2-2.8.170-ex112, the workaround with natural unloading and loading the world is not working anymore.


    If you want anymore information about the Bug you can reliably create the bug on all of our 1.12 Modded Servers. If you want more tests or scenarios, please feel free to ask.


    I hope this Bugs gets the needed attention, since this is very frustrating.

  • AFAIK most of those issues are due to event ordering issues (including the various load/validate notifications on the TEs) or even missing events.


    We don't always see a reliable load -> unload -> load -> unload order, but glitches such as load -> load -> unload -> unload, which makes it very difficult to reliably maintain a representation of the energy grid. Likewise, the wrong world warning in your logs indicate some sort of missing or misplaced event.


    We can only further improve our workarounds, but until we're done with porting to modern MC further work in this area will have to wait.

  • We don't always see a reliable load -> unload -> load -> unload order, but glitches such as load -> load -> unload -> unload, which makes it very difficult to reliably maintain a representation of the energy grid.

    Yesterday, after I wrote this post. I started to find the problem on my own. After testing various kinds of unloading the world, we found out that the DimensionManager.unload creates this Bug. If you execute it, the world is thrown into some kind of unload queue. When it is then really unloaded this happens:


    If you unload the world without the DimensionManager and just execute this, the Bug gets fixed. I haven't looked further into what happens in the time where the World is in this queue, but something in this time is probably causing this.