Skip to content

Enhance inventory serialization and improve player movement#150

Open
Gardo32 wants to merge 2 commits into
ickerio:masterfrom
Gardo32:master
Open

Enhance inventory serialization and improve player movement#150
Gardo32 wants to merge 2 commits into
ickerio:masterfrom
Gardo32:master

Conversation

@Gardo32
Copy link
Copy Markdown

@Gardo32 Gardo32 commented May 14, 2026

This pull request improves the reliability and safety of inventory serialization and player movement event handling in the codebase. The main focus is on ensuring that registry access is always available before performing serialization/deserialization, and that player movement events are triggered on the correct server thread to avoid concurrency issues.

Inventory Serialization Improvements:

  • Added a resolveRegistryAccess() helper to safely obtain RegistryAccess from the current world or server, with error logging if unavailable. This prevents null pointer exceptions during inventory serialization/deserialization.
  • Updated the inventory serializer and deserializer in SerializerRegistry.java to check for valid registry access before proceeding, logging errors and skipping the operation if access is unavailable. [1] [2]

Player Movement Event Handling:

  • Changed the injection point for handling player movement in ServerGamePacketListenerImplMixin.java to the end of the method (@At("TAIL")) and ensured that the onMove event is invoked on the main server thread, scheduling it if necessary. This prevents potential threading issues.
  • Updated onMove in WorldManager.java to use player.chunkPosition() instead of retrieving the chunk from the world, simplifying and possibly optimizing chunk position retrieval.

Dependency Management:

  • Added an import for RegistryAccess in SerializerRegistry.java to support the new registry resolution logic.

@BlueZeeKing
Copy link
Copy Markdown
Collaborator

What is the actual point of these changes? Is the way things are done currently causing any issues?

@Gardo32
Copy link
Copy Markdown
Author

Gardo32 commented May 15, 2026

What is the actual point of these changes? Is the way things are done currently causing any issues?

The main point of these changes is to solve a critical deadlock issue occurring when players from different factions interact with claimed chunks while the VMP mod is active.
​Recent crash reports (specifically Server Watchdog errors) confirmed that the server thread was hanging indefinitely. The logs showed a conflict where the Factions mod (io.icker.factions) was attempting to process player movement and chunk ownership while VMP was managing high-performance networking packets. That causes a tick to 60 seconds that forced the server to crash.

Forgot to create an issue, mb 😅.

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