Skip to content

Switch config to .properties #155

@Protonull

Description

@Protonull
  1. Property files require no additional libraries to parse: it's part of the standard library. This is not an issue currently since Minecraft is providing the json library. But it means there's potential for Minecraft removing the library or changing it.

  2. We can use our own parsing logic. It will mean we can more gracefully handle unexpected types or values. Java has been moving in the direction of types-as-validation: where instead of repeatedly checking that a string is valid, you instead pass the string into a record constructor which throws if it's invalid, so having an instance of that record means by definition that you have a valid string. This pattern is not compatible with the current json library: the exception will just bubble up to fail the entire file.

  3. Same validation steps. It's true that property files are extremely basic, but MapSync's config files are basic. The only potential issue would be the sync addresses since they're stored in an array in json... but they could just be stored as a comma-joined string in the properties file, which means we can then use the same validation logic on the config as on SyncConnectionsGui.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions