Bug: Able to remove last map out of an Atlas
jamtowers opened this issue ยท 1 comments
When using shears in the cartography table it is possible to remove the last filled in map from an atlas, this causes a few undesirable behaviours to happen:
- The game treats the atlas like a newly spawned in atlas, that it it supplies it with additional maps to start filling it in with, which is effectively an exploit to get free maps
- It resets the Atlas scale back to 1:1 even if it was originally a larger scale, which is annoying if you want to merge any of those larger maps back into it
- If you put an atlas with no filled in maps into a cartography table with shears and then try to click the left/right arrows to select another map it crashes the game
The expected behaviour is that the player should not be allowed to remove the last map from an atlas in the first place, an alternative would be to update the mod to handle the above cases gracefully, but just stopping the player from removing all the maps in the first place is probably the path of least resistance since having a mapless atlas seems very unintended.
Mod Version: 1.21-6.3.6-neoforge
Game version: 1.21.1
Neoforge Version: 21.1.211
Ah so looking into it further (writing a patched version for my friends) I made a few discoveries
My first point is moot because that is based on a config, so I can just change that behaviour
My second point is true, easily fixable by putting a check on the merge recipes so if an atlas doesn't have any maps it can merge regardless of the scale
My third point is also true, can be fixed by putting a check on the UI code to not render the buttons when the atlas has no maps
So yeah, you probably don't want to prevent the user from removing the last map like I suggested as having an empty atlas can be handy, you just need to handle the edge cases around it
Edit: If you want me to put up a PR with my changes let me know, they were hacked together so they might not be ideal changes but I don't mind sharing