diff options
| author | Aaron <51387595+AzureAaron@users.noreply.github.com> | 2025-07-19 23:30:52 -0400 |
|---|---|---|
| committer | Aaron <51387595+AzureAaron@users.noreply.github.com> | 2025-07-19 23:30:52 -0400 |
| commit | a4415dce9a84d958f16d3a64c82e47a0217785bb (patch) | |
| tree | 8eb80d1ccc31068e33a477242ab89d67b7b8815e /src/main/java | |
| parent | 210d10702a590035158cb5fb3baa2545ac862ea6 (diff) | |
| download | Skyblocker-a4415dce9a84d958f16d3a64c82e47a0217785bb.tar.gz Skyblocker-a4415dce9a84d958f16d3a64c82e47a0217785bb.tar.bz2 Skyblocker-a4415dce9a84d958f16d3a64c82e47a0217785bb.zip | |
Legacy Ordered Waypoint Loading Fixes
- Fixes it writing the waypoints to the dwarven mines a second time
instead of to the Crystal Hollows.
- Fixes it erroring if the file does not exist or if it was already
moved.
Diffstat (limited to 'src/main/java')
| -rw-r--r-- | src/main/java/de/hysky/skyblocker/skyblock/waypoint/Waypoints.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/waypoint/Waypoints.java b/src/main/java/de/hysky/skyblocker/skyblock/waypoint/Waypoints.java index acefbca3..5184fdd8 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/waypoint/Waypoints.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/waypoint/Waypoints.java @@ -36,7 +36,9 @@ import org.slf4j.LoggerFactory; import java.io.*; import java.nio.charset.StandardCharsets; +import java.nio.file.FileAlreadyExistsException; import java.nio.file.Files; +import java.nio.file.NoSuchFileException; import java.nio.file.Path; import java.util.*; import java.util.function.Function; @@ -108,10 +110,11 @@ public class Waypoints { Collection<WaypointGroup> waypointGroups = SKYBLOCKER_LEGACY_ORDERED_CODEC.parse(JsonOps.INSTANCE, SkyblockerMod.GSON.fromJson(reader, JsonObject.class)).resultOrPartial(LOGGER::error).orElseThrow(); for (WaypointGroup group : waypointGroups) { Waypoints.putWaypointGroup(group.withIsland(Location.DWARVEN_MINES).deepCopy()); - Waypoints.putWaypointGroup(group.withIsland(Location.DWARVEN_MINES).deepCopy()); + Waypoints.putWaypointGroup(group.withIsland(Location.CRYSTAL_HOLLOWS).deepCopy()); } Files.move(SKYBLOCKER_LEGACY_ORDERED_FILE, SkyblockerMod.CONFIG_DIR.resolve("legacy_ordered_waypoints.json")); LOGGER.info("[Skyblocker Waypoints] Successfully migrated {} ordered waypoints from {} groups to waypoints!", waypointGroups.stream().map(WaypointGroup::waypoints).mapToInt(List::size).sum(), waypointGroups.size()); + } catch (NoSuchFileException | FileAlreadyExistsException ignored) { } catch (IOException e) { LOGGER.error("[Skyblocker Waypoints] Encountered exception while loading legacy ordered waypoints", e); } |
