From df9c1b29f0ca35f97e1c74910f6d0e01c2ca6ccb Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Tue, 23 Apr 2024 20:18:43 -0400 Subject: Refactor usages of Optional's orElseThrow to getOrThrow Mojang's method is more concise and provides far superior error messages incase the value isn't present (like why it happened) whereas with Optionals its just the standard value not present message. --- .../de/hysky/skyblocker/skyblock/crimson/kuudra/KuudraWaypoints.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/de/hysky/skyblocker/skyblock/crimson/kuudra') diff --git a/src/main/java/de/hysky/skyblocker/skyblock/crimson/kuudra/KuudraWaypoints.java b/src/main/java/de/hysky/skyblocker/skyblock/crimson/kuudra/KuudraWaypoints.java index 790d434a..00cd85a0 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/crimson/kuudra/KuudraWaypoints.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/crimson/kuudra/KuudraWaypoints.java @@ -60,7 +60,7 @@ public class KuudraWaypoints { private static CompletableFuture loadWaypoints(MinecraftClient client, Identifier file, ObjectArrayList list, float[] colorComponents) { return CompletableFuture.supplyAsync(() -> { try (BufferedReader reader = client.getResourceManager().openAsReader(file)) { - return CODEC.apply(colorComponents).parse(JsonOps.INSTANCE, getWaypoints(reader)).result().orElseThrow(); + return CODEC.apply(colorComponents).parse(JsonOps.INSTANCE, getWaypoints(reader)).getOrThrow(); } catch (Exception e) { LOGGER.error("[Skyblocker Kuudra Waypoints] Failed to load kuudra waypoints from: {}", file, e); -- cgit