Create: Copycats+

Create: Copycats+

10M Downloads

[Bug] CRASH/WORLD CORRUPTION - World crash and corruption after creating and moving complex byte setup using external tools

Sorien787 opened this issue ยท 0 comments

commented

After creating a large and complex byte/layer building, and subsequently moving the blocks with worldedit/axiom, the bytes can sometimes end up with corrupted/unexpected data, causing a crash, and corrupting the world entirely. I'm assuming I can recover the world by deleting the blocks that caused the corruption using an external program.

To Reproduce

  • Enter a singleplayer world with create copycats + and worldedit/axiom
  • Build a structure using a large amount of bytes/layers
  • Move the structure using worldedit/axiom
  • This will sometimes result in world corruption

Repro rate
not 100%, since moved bytes around using axiom perfectly fine. Not entirely sure what causes the bytes to sometimes enter an invalid state.

Expected behavior
If an external tool leaves bytes in an invalid state, I would expect one of the following:

  • The block entity should be destroyed
  • The block entity should be created in as reasonable a configuration as possible

Suggested fix
I'm being cheeky here, but maybe a good quick-ish fix would be:

  • Check if the byte map has the requested property
  • If it doesnt, return an optional for whever the byte map is read (I.E, change API of GetVectorFromProperty, GetColorIndex to return optionals of their respective values)
  • If whatever calls the above function gets a valid optional returned, then it continues as normal.
  • Otherwise, seeing as this is only really used in generating block state, just ignore the bad data

Or just return an arbitrary vector and let the player fix whatever weird shit axiom/worldedit has left. Anything is better than a world corruption honestly

Desktop (please complete the following information):

  • Minecraft Version - 1.20.1
  • Mod Loader - Forge + Sinytra connector/Forgified Fabric API (for running axiom)
  • Mod Version - 3.0.2

Provided crash log showing call stack of crash

CopyCatCrash.txt