Description
Minecraft Version: 1.21.5
**NeoForge Version:**21.5.14-beta
Logs: Crash report https://pastebin.com/87ZLwbQ9
Steps to Reproduce:
- Create a new singleplayer world
- Through a custom mod/test mod, request any chunk using NeoForge's
TicketController
for a BlockPos owner or an Entity owner. I did this the following way:SecurityCraft.CAMERA_TICKET_CONTROLLER.forceChunk(serverLevel, dummyEntity, x, z, true, false);
withdummyEntity
being of typeSecurityCamera
. - Allow your world to save, either by entering the pause menu or waiting until the world autosaves.
- Observe the game crashing
Description of issue:
As discussed in Discord, the issue is NeoForge's ForcedChunkManager trying to encode its chunks in vanilla's TicketStorage
(see TicketStorage#37
), and using a custom codec to do so. This codec effectively tries to save a Map<UUID, TicketSet>
and a Map<BlockPos, TicketSet>
to NBT, for storage within the world data file. However, for the Java maps to be properly convertible to a CompoundTag
for storage, both key entries (BlockPos and UUID) need to be serialized to a String
, which is not happening currently due to the wrong codecs being used (they're currently both converted to an IntStream
, which CompoundTag
cannot deal with). This leads the game to crash since the ForcedChunkManager data cannot be saved to NBT.
Relevant Discord conversation with potential suggestions: https://discord.com/channels/313125603924639766/852298000042164244/1357804883260084395