You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Register a data pack source with AddPackFindersEvent but don't turn it on by default.
Create a world, and save and exit.
Re-enter the world, and enable the data pack with the /datapack command.
Exit the world, then re-enter.
The data pack is not enabled.
Description of issue:
During runtime it seems that the list of data packs is stored in order in a PackRepository. But the list is also stored in duplicate in PrimaryLevelData -> LevelSettings -> WorldDataConfiguration -> DataPackConfig. This is what gets stored in level.dat. Unfortunately, these two storages are desynced. Whenever there is a reload, the idea is that the ordered list of datapacks in the world's PackRepository gets copied to the DataPackConfig, but that does not occur due to an error in this method:
As you can see, the world's LevelSettings gets passed a WorldDataConfiguration (which, checking at runtime, does indeed contain the correct order of data packs), but this value is completely unused because the field passed to the constructor is the object field dataConfiguration rather than the argument pDataConfiguration. I am assuming that pDataConfiguration was the thing that was meant to be passed on, because all of the other object fields are preceded by the this..
The result is that if you change the list of datapacks during runtime, they are correctly ordered while the level is open, but it is the old list which gets saved, so when you re-open the world next time it has reverted to whatever datapacks the world was originally created with.
Fix:
Simply changing dataConfiguration to pDataConfiguration fixes this. I've done it myself with a Mixin for my mod and it seems to work fine.
The text was updated successfully, but these errors were encountered:
petrolpark
added
the
Triage
This request requires the active attention of the Triage Team. Requires labelling or reviews.
label
Apr 25, 2024
petrolpark
changed the title
Data Packs get forget they are enabled, or get loaded in the wrong order
Data Packs forget they are enabled, or get loaded in the wrong order
Apr 25, 2024
Minecraft Version: 1.20.1
Forge Version: 47.2.4
Steps to Reproduce:
AddPackFindersEvent
but don't turn it on by default./datapack
command.Description of issue:
During runtime it seems that the list of data packs is stored in order in a
PackRepository
. But the list is also stored in duplicate inPrimaryLevelData
->LevelSettings
->WorldDataConfiguration
->DataPackConfig
. This is what gets stored inlevel.dat
. Unfortunately, these two storages are desynced. Whenever there is a reload, the idea is that the ordered list of datapacks in the world'sPackRepository
gets copied to theDataPackConfig
, but that does not occur due to an error in this method:As you can see, the world's
LevelSettings
gets passed aWorldDataConfiguration
(which, checking at runtime, does indeed contain the correct order of data packs), but this value is completely unused because the field passed to the constructor is the object fielddataConfiguration
rather than the argumentpDataConfiguration
. I am assuming thatpDataConfiguration
was the thing that was meant to be passed on, because all of the other object fields are preceded by thethis.
.The result is that if you change the list of datapacks during runtime, they are correctly ordered while the level is open, but it is the old list which gets saved, so when you re-open the world next time it has reverted to whatever datapacks the world was originally created with.
Fix:
Simply changing
dataConfiguration
topDataConfiguration
fixes this. I've done it myself with a Mixin for my mod and it seems to work fine.The text was updated successfully, but these errors were encountered: