Dragon Survival [Forge]

Dragon Survival [Forge]

685k Downloads

[1.18.2 Forge Bug]: Backwards Compatibility with DragonLevel Enum changes for saved_customization.json

wchen1990 opened this issue · 2 comments

commented

■ Your Discord ID

BobDole#8232

■ Dragon Survival version

DragonSurvival_DragonEditor-1.18.2-1.4.19.jar

■ Single game or server?

Single (Default)

■ Do you delete old configs before writing a bug report?

Nope (Default)

■ Do you play pure MC + DS and Geckolib or do you have some kind of modpack?

I have other mods

■ Describe the bug

In commit, 892b377, DragonLevel.BABY was renamed to DragonLevel.NEWBORN, which makes sense given that it was just a change to match the actual value of the field. However, since saved_customization.json is serialized using the Enum value itself this causes a backwards compatibility issue with saved_customizations,json that were made previous to this commit.

The solution for this would be just to add this line:
@SerializedName(value = "NEWBORN", alternate = "BABY")
above:

This will make is so that any saved_customizations.json that were created prior to any releases that didn't have the enum refactor to still work and the new saved_customizations.json file created will have the updated value.

Without this people with old saved_customizations will still be able to load the game but the newborn form would not be visible to the player until they saved their customization again in the dragon editor.

■ To Reproduce

  1. Have a saved_customizations.json file from a version of Dragon Survival that did not have the DragonLevel.NEWBORN refactor
  2. Load the game with a version of Dragon Survival with the refactor
  3. Look at your newborn/baby customization

■ Expected behavior

Saved customizations should be carried over from older versions of Dragon Survival.

■ Crash Report

N/A

commented

Ah, yeah, that's an oversight on my part. Thanks for the report, will get that fixed.

commented

Wow, this is the best bug report we could ever dream of :O