Skip to content

Update to 1.21.5#60

Merged
PotatoPresident merged 8 commits intoQuiltServerTools:masterfrom
eclipseisoffline:1.21.5
Apr 13, 2025
Merged

Update to 1.21.5#60
PotatoPresident merged 8 commits intoQuiltServerTools:masterfrom
eclipseisoffline:1.21.5

Conversation

@eclipseisoffline
Copy link
Copy Markdown
Contributor

@eclipseisoffline eclipseisoffline commented Mar 21, 2025

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 HTMContainerLock class 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 of HTMContainerLock when they're actually locked. Flags are now also no longer done using strings, but rather using a FlagType enum. The code has also been cleaned up a bit in general.

Lockable objects now store their lock information under the container_lock NBT 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.

@eclipseisoffline
Copy link
Copy Markdown
Contributor Author

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.

@eclipseisoffline
Copy link
Copy Markdown
Contributor Author

Refactor should be finished now. The big changes are turning HTMContainerLock into a record, fully switching to codecs to serialise lock data, and making LockableObjects only store a HTMContainerLock when they're actually locked. I'll also put a more in depth description in the PR description itself.

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.

@eclipseisoffline eclipseisoffline marked this pull request as ready for review April 2, 2025 12:04
Copy link
Copy Markdown
Member

@PotatoPresident PotatoPresident left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

@PotatoPresident PotatoPresident merged commit e9b0fab into QuiltServerTools:master Apr 13, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants