diff options
author | NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> | 2024-05-30 03:51:53 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-29 19:51:53 +0200 |
commit | fe625428273cf9bba1c5e3ed1327600ee63ef0ff (patch) | |
tree | a24d01ebaaa5d93f51a318fab9dc8be793a658f5 | |
parent | d366be39e375827e01838c66362143e1e5a34e88 (diff) | |
download | NotEnoughUpdates-fe625428273cf9bba1c5e3ed1327600ee63ef0ff.tar.gz NotEnoughUpdates-fe625428273cf9bba1c5e3ed1327600ee63ef0ff.tar.bz2 NotEnoughUpdates-fe625428273cf9bba1c5e3ed1327600ee63ef0ff.zip |
Fix OneConfig crashing on the mining settings (#1187)
3 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Mining.java b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Mining.java index 4ccd2a06..509151f6 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Mining.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Mining.java @@ -29,6 +29,7 @@ import io.github.moulberry.moulconfig.annotations.ConfigEditorDraggableList; import io.github.moulberry.moulconfig.annotations.ConfigEditorDropdown; import io.github.moulberry.moulconfig.annotations.ConfigEditorSlider; import io.github.moulberry.moulconfig.annotations.ConfigOption; +import io.github.moulberry.moulconfig.observer.Property; import io.github.moulberry.notenoughupdates.core.config.Position; import org.jetbrains.annotations.NotNull; @@ -103,7 +104,7 @@ public class Mining { ) @ConfigEditorDropdown @ConfigAccordionId(id = 0) - public @NotNull GlaciteTunnelWaypointBehaviour tunnelWaypoints = GlaciteTunnelWaypointBehaviour.SHOW_ALL; + public @NotNull Property<GlaciteTunnelWaypointBehaviour> tunnelWaypoints = Property.of(GlaciteTunnelWaypointBehaviour.SHOW_ALL); @Expose @ConfigOption( diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java index b21a332b..adecb334 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java @@ -268,7 +268,7 @@ public class MiningOverlay extends TextTabOverlay { NotEnoughUpdates.INSTANCE.config.mining.emissaryWaypoints == 0 && !NotEnoughUpdates.INSTANCE.config.mining.titaniumAlert && NotEnoughUpdates.INSTANCE.config.mining.locWaypoints == 0 - && NotEnoughUpdates.INSTANCE.config.mining.tunnelWaypoints != Mining.GlaciteTunnelWaypointBehaviour.NONE + && NotEnoughUpdates.INSTANCE.config.mining.tunnelWaypoints.get() != Mining.GlaciteTunnelWaypointBehaviour.NONE && HotmDesires.wantsPowderInfo()) { return; } diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/GlaciteTunnelWaypoints.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/GlaciteTunnelWaypoints.kt index cb4c8377..3c19f396 100644 --- a/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/GlaciteTunnelWaypoints.kt +++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/GlaciteTunnelWaypoints.kt @@ -70,7 +70,7 @@ object GlaciteTunnelWaypoints { @SubscribeEvent fun onRender(event: RenderWorldLastEvent) { - if (NotEnoughUpdates.INSTANCE.config.mining.tunnelWaypoints == Mining.GlaciteTunnelWaypointBehaviour.NONE) + if (NotEnoughUpdates.INSTANCE.config.mining.tunnelWaypoints.get() == Mining.GlaciteTunnelWaypointBehaviour.NONE) return if (SBInfo.getInstance().scoreboardLocation !in glaciteTunnelLocations) @@ -83,7 +83,7 @@ object GlaciteTunnelWaypoints { val player = Minecraft.getMinecraft().thePlayer?.position ?: return for (entry in wantedGemstones) { val waypoints = waypointsForQuest[entry] ?: continue - val waypointLocations = when (NotEnoughUpdates.INSTANCE.config.mining.tunnelWaypoints) { + val waypointLocations = when (NotEnoughUpdates.INSTANCE.config.mining.tunnelWaypoints.get()) { Mining.GlaciteTunnelWaypointBehaviour.SHOW_ALL -> { waypoints.waypoints } @@ -92,7 +92,7 @@ object GlaciteTunnelWaypoints { listOf(waypoints.waypoints.minByOrNull { it.distanceSq(player) }) } - Mining.GlaciteTunnelWaypointBehaviour.NONE -> break + else -> break } for (waypoint in waypointLocations) { if (waypoint == null) continue |