diff options
author | Linnea Gräf <nea@nea.moe> | 2024-08-04 21:10:08 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-08-04 21:10:08 +0200 |
commit | 9b277bd897490d13ee4549a086e8d1b5f4cd0e10 (patch) | |
tree | 8f966a8f5b981cb700becb337e43970eb0619fcc /src/main/kotlin/moe/nea/firmament/features | |
parent | 95c1b75a14d41b070c4e23addb3ac4788a014365 (diff) | |
download | firmament-9b277bd897490d13ee4549a086e8d1b5f4cd0e10.tar.gz firmament-9b277bd897490d13ee4549a086e8d1b5f4cd0e10.tar.bz2 firmament-9b277bd897490d13ee4549a086e8d1b5f4cd0e10.zip |
Add SkyBlockIsland type
[no changelog]
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/features')
3 files changed, 11 insertions, 12 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/features/diana/AncestralSpadeSolver.kt b/src/main/kotlin/moe/nea/firmament/features/diana/AncestralSpadeSolver.kt index fb7e8da..21c6453 100644 --- a/src/main/kotlin/moe/nea/firmament/features/diana/AncestralSpadeSolver.kt +++ b/src/main/kotlin/moe/nea/firmament/features/diana/AncestralSpadeSolver.kt @@ -19,6 +19,7 @@ import moe.nea.firmament.events.WorldRenderLastEvent import moe.nea.firmament.events.subscription.SubscriptionOwner import moe.nea.firmament.features.FirmamentFeature import moe.nea.firmament.util.SBData +import moe.nea.firmament.util.SkyBlockIsland import moe.nea.firmament.util.TimeMark import moe.nea.firmament.util.WarpUtil import moe.nea.firmament.util.render.RenderInWorldContext @@ -34,7 +35,7 @@ object AncestralSpadeSolver : SubscriptionOwner { private var lastTeleportAttempt = TimeMark.farPast() fun isEnabled() = - DianaWaypoints.TConfig.ancestralSpadeSolver && SBData.skyblockLocation == "hub" + DianaWaypoints.TConfig.ancestralSpadeSolver && SBData.skyblockLocation == SkyBlockIsland.HUB @Subscribe fun onKeyBind(event: WorldKeyboardEvent) { @@ -42,7 +43,7 @@ object AncestralSpadeSolver : SubscriptionOwner { if (!event.matches(DianaWaypoints.TConfig.ancestralSpadeTeleport)) return if (lastTeleportAttempt.passedTime() < 3.seconds) return - WarpUtil.teleportToNearestWarp("hub", nextGuess ?: return) + WarpUtil.teleportToNearestWarp(SkyBlockIsland.HUB, nextGuess ?: return) lastTeleportAttempt = TimeMark.now() } diff --git a/src/main/kotlin/moe/nea/firmament/features/inventory/SlotLocking.kt b/src/main/kotlin/moe/nea/firmament/features/inventory/SlotLocking.kt index fbae4bf..14814e7 100644 --- a/src/main/kotlin/moe/nea/firmament/features/inventory/SlotLocking.kt +++ b/src/main/kotlin/moe/nea/firmament/features/inventory/SlotLocking.kt @@ -31,6 +31,7 @@ import moe.nea.firmament.mixins.accessor.AccessorHandledScreen import moe.nea.firmament.util.CommonSoundEffects import moe.nea.firmament.util.MC import moe.nea.firmament.util.SBData +import moe.nea.firmament.util.SkyBlockIsland import moe.nea.firmament.util.data.ProfileSpecificDataHolder import moe.nea.firmament.util.item.displayNameAccordingToNbt import moe.nea.firmament.util.item.loreAccordingToNbt @@ -66,7 +67,7 @@ object SlotLocking : FirmamentFeature { val lockedSlots get() = when (SBData.skyblockLocation) { - "rift" -> DConfig.data?.lockedSlotsRift + SkyBlockIsland.RIFT -> DConfig.data?.lockedSlotsRift null -> null else -> DConfig.data?.lockedSlots } diff --git a/src/main/kotlin/moe/nea/firmament/features/world/FairySouls.kt b/src/main/kotlin/moe/nea/firmament/features/world/FairySouls.kt index 2cce041..36ec495 100644 --- a/src/main/kotlin/moe/nea/firmament/features/world/FairySouls.kt +++ b/src/main/kotlin/moe/nea/firmament/features/world/FairySouls.kt @@ -1,5 +1,6 @@ /* * SPDX-FileCopyrightText: 2023 Linnea Gräf <nea@nea.moe> + * SPDX-FileCopyrightText: 2024 Linnea Gräf <nea@nea.moe> * * SPDX-License-Identifier: GPL-3.0-or-later */ @@ -20,6 +21,7 @@ import moe.nea.firmament.gui.config.ManagedConfig import moe.nea.firmament.repo.RepoManager import moe.nea.firmament.util.MC import moe.nea.firmament.util.SBData +import moe.nea.firmament.util.SkyBlockIsland import moe.nea.firmament.util.blockPos import moe.nea.firmament.util.data.ProfileSpecificDataHolder import moe.nea.firmament.util.render.RenderInWorldContext @@ -32,7 +34,7 @@ object FairySouls : FirmamentFeature { @Serializable data class Data( - val foundSouls: MutableMap<String, MutableSet<Int>> = mutableMapOf() + val foundSouls: MutableMap<SkyBlockIsland, MutableSet<Int>> = mutableMapOf() ) override val config: ManagedConfig @@ -55,7 +57,7 @@ object FairySouls : FirmamentFeature { val playerReach = 5 val playerReachSquared = playerReach * playerReach - var currentLocationName: String? = null + var currentLocationName: SkyBlockIsland? = null var currentLocationSouls: List<Coordinate> = emptyList() var currentMissingSouls: List<Coordinate> = emptyList() @@ -71,7 +73,7 @@ object FairySouls : FirmamentFeature { fun updateWorldSouls() { currentLocationSouls = emptyList() val loc = currentLocationName ?: return - currentLocationSouls = RepoManager.neuRepo.constants.fairySouls.soulLocations[loc] ?: return + currentLocationSouls = RepoManager.neuRepo.constants.fairySouls.soulLocations[loc.locrawMode] ?: return } fun findNearestClickableSoul(): Coordinate? { @@ -79,7 +81,7 @@ object FairySouls : FirmamentFeature { val pos = player.pos val location = SBData.skyblockLocation ?: return null val soulLocations: List<Coordinate> = - RepoManager.neuRepo.constants.fairySouls.soulLocations[location] ?: return null + RepoManager.neuRepo.constants.fairySouls.soulLocations[location.locrawMode] ?: return null return soulLocations .map { it to it.blockPos.getSquaredDistance(pos) } .filter { it.second < playerReachSquared } @@ -101,11 +103,6 @@ object FairySouls : FirmamentFeature { fun onWorldRender(it: WorldRenderLastEvent) { if (!TConfig.displaySouls) return renderInWorld(it) { - text(Vec3d(0.0, 0.0, 0.0), - Text.literal("Test String"), - Text.literal("Short"), - Text.literal("just lik"), - verticalAlign = RenderInWorldContext.VerticalAlign.BOTTOM) color(1F, 1F, 0F, 0.8F) currentMissingSouls.forEach { block(it.blockPos) |