AtriusX / Waystones

A small plugin that brings long-distance teleportation to Minecraft survival mode!
https://www.spigotmc.org/resources/waystones.93917/
11 stars 7 forks source link

Fix JSON saving does not truncate the old file #18

Closed NewbieOrange closed 3 years ago

NewbieOrange commented 3 years ago

Fix saving broken JSON files if the new content is shorter than the older files.

AtriusX commented 3 years ago

There was definitely a weird JSON issue we couldn't reproduce in the past. Did you confirm that this fixes the issue? Also @Sepshun please double-check this as well.

NewbieOrange commented 3 years ago

Yes, I have tested it fixed my issue.

To reproduce the issue:

  1. Have a clean state (empty json)
  2. Rename a waystone
  3. Destroy the waystone
  4. Check the json file
AtriusX commented 3 years ago

Alright cool, once @Sepshun confirms then I'll merge the change.

luna-skye commented 3 years ago

Sorry it took so long, I'm pulling this to test right now though!

luna-skye commented 3 years ago

Tested and good to merge and close imo!

Though it's a little inconsistent compared to the bug we were facing, as in our case it would occur seemingly at random without having named a waystone at all, which made it quite difficult to track. However, this change does fix the issue as far as I can tell!