Update to 1.21.5#60
Conversation
|
Sorry for the delay in updates. I started working on a decent refactor to the code, to clean it up and to prepare for a full switch to using data components to serialise block entities, which is likely to happen in the next Minecraft update. I hope to have this finished this week, and if I not I'll just fix what is here right now and work on the refactor after the initial 1.21.5 update. |
|
Refactor should be finished now. The big changes are turning Backwards compatibility has been tested with 1.21.4, and in theory all worlds since 1.20.5 should have no issues when updating to this version. |
This PR updates the mod to 1.21.5, and does a decently big refactor to the code, to clean it up and to prepare for possible future changes to how Minecraft stores data for block entities. These changes should also fix some bugs, such as changes in a container's lock info sometimes not saving properly.
The
HTMContainerLockclass has been turned into an immutable record with a codec which is used to serialise it in lockable objects. Lockable objects now also only store an instance ofHTMContainerLockwhen they're actually locked. Flags are now also no longer done using strings, but rather using aFlagTypeenum. The code has also been cleaned up a bit in general.Lockable objects now store their lock information under the
container_lockNBT key, rather than in the root tag to prevent conflicts with other mods.These changes have been tested decently extensively, and loading older worlds from 1.21.4 has been tested as well. This all seemed to work well, with no issues found.