Mekanism

Mekanism

111M Downloads

[8.0.0] Worlds played in v7 have broken factories

codewarrior0 opened this issue ยท 15 comments

commented

Still not fixed as of 763aef4.

All factories from worlds made with Mek 7.1.2.179 turn into unconfigured smelting factories with blank faces when played in v8.

Factories in v7:
v7

Factories in 763aef4:
v8
This was an Injecting factory before. (And also, it looks like the Metallurgic Infuser lost its rotation setting too.)

commented

That's disappointing.

commented

You may be able to get around it by keeping the factories in your inventory before updating - the issue should only occur when a factory is loaded as a block in v8.
EDIT:
If you're willing to test, would you mind checking your logs when a world is loaded that contains factories transitioning from v7 to v8? It should provide some kind of error report if it is indeed an issue with NBT loading.

commented

Yes - there is sadly not much I can do to fix this. I am putting a statement up warning users about this issue on my website when I release.

commented

Scratch all that - I managed to find a fix that prevents factories from becoming corrupt on world load.

commented

You're on the right track! As of d3df5c5 the factories keep their type and have the right block models (and the infusers keep their rotation too), but the side configuration did revert to the defaults, as you might expect.

The last thing to do is migrate the old side configuration and at least apply it to the new configuration for transmitting items.

sideconf

commented

Ooh, so close. (using 6bea59a)

java.lang.IndexOutOfBoundsException: Index: 5, Size: 5                                                      
    at java.util.ArrayList.rangeCheck(Unknown Source)                                                         
    at java.util.ArrayList.get(Unknown Source)                                                                
    at mekanism.common.tile.component.TileComponentConfig.getOutput(TileComponentConfig.java:125)             
    at mekanism.common.tile.TileEntityFactory.func_94128_d(TileEntityFactory.java:906)                        
    at mekanism.common.util.TransporterUtils.isValidAcceptorOnSide(TransporterUtils.java:68)                  
    at mekanism.common.multipart.PartLogisticalTransporter.isValidAcceptor(PartLogisticalTransporter.java:139)
    at mekanism.common.multipart.PartSidedPipe.canConnectToAcceptor(PartSidedPipe.java:719)                   

The old values of config# don't quite line up with the new ones. My best guess is to find the SideData in sideOutputs whose slots contains the old value of config#, and store the index into sideOutputs as the new value in the bytearray. But I could be wrong, you'd know better than I do. Yeah, that's probably wrong.

commented

Oh, and one more thing. Migrate the upgrades ;)

commented

Just pushed a commit that should properly transition custom side item configuration, mind testing? I'll look into speed/energy upgrades now :)

commented

Upgrades should now be migrated too!

commented

Just pushed the fix - I'm pretty sure you're right.

commented

The old colors are GREY ORANGE DARK_GREEN PURPLE DARK_RED DARK_BLUE

The new colors are GREY DARK_GREEN PURPLE DARK_RED DARK_BLUE

So it looks like you just have to subtract 1 when the old side config is >0. Hang on, I'll give it a try.

commented

Done :)
Let me know if I can do anything else.

commented

Yep, that did the trick! Great work! As of b096202, all my factories, infusers, and other machines have the same side configuration AND upgrades as before.

Though, if I could ask you for one more thing? Migrate the auto-eject setting?

commented

Of course! Thanks for your help along the way.

commented

Wonderful. My entire ore processing chain now survives the v8 transition completely intact!

Except for a minor hangup with the Chemical Crystallizer's output faces getting changed. But the fix for that is kind of hairy. Subtracting 1 from the old side config only works for the generic Factory faces, and since each of the other machine types has its own set of SideDatas, you'd have to have TileComponentConfig know which type of machine it is migrating side data for... and know all of the old->new mappings for all the different machines. And I'll bet neither of us know all of that. Icky.

But just having all of the Factories survive the transition is going to make a lot of people happy. Thanks for getting this fixed.