From 9e4618d960d89b60b7a652bb5e4b6d118299e2c4 Mon Sep 17 00:00:00 2001 From: Jordyrat Date: Fri, 16 May 2025 17:57:34 +0100 Subject: [PATCH 1/7] Improves existing pearl waypoints and adds option for prio waypoints (whilst hideFarWaypoints enabled) --- .../me/odinmain/features/impl/nether/NoPre.kt | 171 +++++++++++++++--- .../features/impl/nether/PearlWaypoints.kt | 170 +++++++++++++---- .../me/odinmain/utils/skyblock/KuudraUtils.kt | 4 + 3 files changed, 284 insertions(+), 61 deletions(-) diff --git a/src/main/kotlin/me/odinmain/features/impl/nether/NoPre.kt b/src/main/kotlin/me/odinmain/features/impl/nether/NoPre.kt index 234e2169e..ca81b2e8f 100644 --- a/src/main/kotlin/me/odinmain/features/impl/nether/NoPre.kt +++ b/src/main/kotlin/me/odinmain/features/impl/nether/NoPre.kt @@ -21,6 +21,7 @@ object NoPre : Module( private var preSpot = SupplyPickUpSpot.None var missing = SupplyPickUpSpot.None + var prio = SupplyPickUpSpot.None init { onMessage(Regex("\\[NPC] Elle: Head over to the main platform, I will join you when I get a bite!")) { @@ -81,62 +82,172 @@ object NoPre : Module( return when (missing) { // Shop Missing SupplyPickUpSpot.Shop -> when (preSpot) { - SupplyPickUpSpot.Triangle, SupplyPickUpSpot.X -> "Go X Cannon" - SupplyPickUpSpot.Equals, SupplyPickUpSpot.Slash -> "Go Square, place on Shop" - else -> "" + SupplyPickUpSpot.Triangle, SupplyPickUpSpot.X -> { + prio = SupplyPickUpSpot.xCannon + "Go X Cannon" + } + SupplyPickUpSpot.Equals, SupplyPickUpSpot.Slash -> { + prio = SupplyPickUpSpot.Square + "Go Square, place on Shop" + } + else -> { + prio = SupplyPickUpSpot.None + "" + } } // Triangle Missing SupplyPickUpSpot.Triangle -> when (preSpot) { - SupplyPickUpSpot.Triangle -> if (advanced) "Pull Square and X Cannon. Next: collect Shop" else "Pull Square. Next: collect Shop" - SupplyPickUpSpot.X -> "Go X Cannon" - SupplyPickUpSpot.Equals -> if (advanced) "Go Shop" else "Go X Cannon" - SupplyPickUpSpot.Slash -> "Go Square, place on Triangle" - else -> "" + SupplyPickUpSpot.Triangle -> { + prio = SupplyPickUpSpot.None + if (advanced) "Pull Square and X Cannon. Next: collect Shop" else "Pull Square. Next: collect Shop" + } + SupplyPickUpSpot.X -> { + prio = SupplyPickUpSpot.xCannon + "Go X Cannon" + } + SupplyPickUpSpot.Equals -> { + if (advanced) { + prio = SupplyPickUpSpot.Shop + "Go Shop" + } else { + prio = SupplyPickUpSpot.xCannon + "Go X Cannon" + } + } + SupplyPickUpSpot.Slash -> { + prio = SupplyPickUpSpot.Square + "Go Square, place on Triangle" + } + else -> { + prio = SupplyPickUpSpot.None + "" + } } // Equals Missing SupplyPickUpSpot.Equals -> when (preSpot) { - SupplyPickUpSpot.Triangle -> if (advanced) "Go Shop" else "Go X Cannon" - SupplyPickUpSpot.X -> "Go X Cannon" - SupplyPickUpSpot.Equals -> if (advanced) "Pull Square and X Cannon. Next: collect Shop" else "Pull Square. Next: collect Shop" - SupplyPickUpSpot.Slash -> "Go Square, place on Equals" - else -> "" + SupplyPickUpSpot.Triangle -> { + if (advanced) { + prio = SupplyPickUpSpot.Shop + "Go Shop" + } else { + prio = SupplyPickUpSpot.xCannon + "Go X Cannon" + } + } + SupplyPickUpSpot.X -> { + prio = SupplyPickUpSpot.xCannon + "Go X Cannon" + } + SupplyPickUpSpot.Equals -> { + prio = SupplyPickUpSpot.Shop + if (advanced) "Pull Square and X Cannon. Next: collect Shop" else "Pull Square. Next: collect Shop" + } + SupplyPickUpSpot.Slash -> { + prio = SupplyPickUpSpot.Square + "Go Square, place on Equals" + } + else -> { + prio = SupplyPickUpSpot.None + "" + } } // Slash Missing SupplyPickUpSpot.Slash -> when (preSpot) { - SupplyPickUpSpot.Triangle -> "Go Square, place on Slash" - SupplyPickUpSpot.X -> "Go X Cannon" - SupplyPickUpSpot.Equals -> if (advanced) "Go Shop" else "Go X Cannon" - SupplyPickUpSpot.Slash -> if (advanced) "Pull Square and X Cannon. Next: collect Shop" else "Pull Square. Next: collect Shop" - else -> "" + SupplyPickUpSpot.Triangle -> { + prio = SupplyPickUpSpot.Square + "Go Square, place on Slash" + } + SupplyPickUpSpot.X -> { + prio = SupplyPickUpSpot.xCannon + "Go X Cannon" + } + SupplyPickUpSpot.Equals -> { + if (advanced) { + prio = SupplyPickUpSpot.Shop + "Go Shop" + } else { + prio = SupplyPickUpSpot.xCannon + "Go X Cannon" + } + } + SupplyPickUpSpot.Slash -> { + prio = SupplyPickUpSpot.Shop + if (advanced) "Pull Square and X Cannon. Next: collect Shop" else "Pull Square. Next: collect Shop" + } + else -> { + prio = SupplyPickUpSpot.None + "" + } } // Square Missing SupplyPickUpSpot.Square -> when (preSpot) { - SupplyPickUpSpot.Triangle, SupplyPickUpSpot.Equals -> "Go Shop" - SupplyPickUpSpot.X, SupplyPickUpSpot.Slash -> "Go X Cannon" - else -> "" + SupplyPickUpSpot.Triangle, SupplyPickUpSpot.Equals -> { + prio = SupplyPickUpSpot.Shop + "Go Shop" + } + SupplyPickUpSpot.X, SupplyPickUpSpot.Slash -> { + prio = SupplyPickUpSpot.xCannon + "Go X Cannon" + } + else -> { + prio = SupplyPickUpSpot.None + "" + } } // X Cannon Missing SupplyPickUpSpot.xCannon -> when (preSpot) { - SupplyPickUpSpot.Triangle, SupplyPickUpSpot.Equals -> "Go Shop" - SupplyPickUpSpot.Slash, SupplyPickUpSpot.X -> "Go Square, place on X Cannon" - else -> "" + SupplyPickUpSpot.Triangle, SupplyPickUpSpot.Equals -> { + prio = SupplyPickUpSpot.Shop + "Go Shop" + } + SupplyPickUpSpot.Slash, SupplyPickUpSpot.X -> { + prio = SupplyPickUpSpot.Square + "Go Square, place on X Cannon" + } + else -> { + prio = SupplyPickUpSpot.None + "" + } } // X Missing SupplyPickUpSpot.X -> when (preSpot) { - SupplyPickUpSpot.Triangle -> "Go X Cannon" - SupplyPickUpSpot.X -> if (advanced) "Pull Square and X Cannon. Next: collect Shop" else "Pull Square. Next: collect Shop" - SupplyPickUpSpot.Equals -> if (advanced) "Go Shop" else "Go X Cannon" - SupplyPickUpSpot.Slash -> "Go Square, place on X" - else -> "" + SupplyPickUpSpot.Triangle -> { + prio = SupplyPickUpSpot.xCannon + "Go X Cannon" + } + SupplyPickUpSpot.X -> { + prio = SupplyPickUpSpot.Shop + if (advanced) "Pull Square and X Cannon. Next: collect Shop" else "Pull Square. Next: collect Shop" + } + SupplyPickUpSpot.Equals -> { + if (advanced) { + prio = SupplyPickUpSpot.Shop + "Go Shop" + } else { + prio = SupplyPickUpSpot.xCannon + "Go X Cannon" + } + } + SupplyPickUpSpot.Slash -> { + prio = SupplyPickUpSpot.Square + "Go Square, place on X" + } + else -> { + prio = SupplyPickUpSpot.None + "" + } } - else -> "" + else -> { + prio = SupplyPickUpSpot.None + "" + } } } } \ No newline at end of file diff --git a/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt b/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt index 7ae331af4..7a5b61a50 100644 --- a/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt +++ b/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt @@ -1,6 +1,8 @@ package me.odinmain.features.impl.nether +import jdk.nashorn.internal.ir.Block import me.odinmain.features.Module +import me.odinmain.features.settings.Setting.Companion.withDependency import me.odinmain.features.settings.impl.BooleanSetting import me.odinmain.utils.render.Color import me.odinmain.utils.render.Renderer @@ -19,65 +21,164 @@ object PearlWaypoints : Module( desc = "Renders waypoints for pearls in Kuudra." ) { private val hideFarWaypoints by BooleanSetting("Hide Far Waypoints", true, desc = "Hides the waypoints that are not the closest to you.") + private val showPriorityWaypoints by BooleanSetting("Show Priority Waypoints", false, "Shows waypoints to land at your priority crate.").withDependency { hideFarWaypoints } private val pearlLineups: Map = mapOf( - // Triangle Lineup( - startPos = setOf(BlockPos(-71, 79, -135), BlockPos(-86, 78, -129)), - lineups = setOf(BlockPos(-97, 157, -114)) + supply = SupplyPickUpSpot.ShopCorner, + startPos = setOf(BlockPos(-71, 79, -135)), + lineups = setOf(BlockPos(0, 0, 0)) + ) to Colors.MINECRAFT_DARK_RED, + Lineup( + supply = SupplyPickUpSpot.Shop, + startPos = setOf(BlockPos(-86, 78, -129)), + lineups = setOf(BlockPos(-97, 159, -112)) ) to Colors.MINECRAFT_RED, - // Triangle 2 Lineup( + supply = SupplyPickUpSpot.Triangle, startPos = setOf(BlockPos(-68, 77, -123)), - lineups = setOf(BlockPos(-96, 161, -105)) + lineups = setOf(BlockPos(-93, 155, -105)) ) to Colors.MINECRAFT_LIGHT_PURPLE, - // X Lineup( + supply = SupplyPickUpSpot.X, startPos = setOf(BlockPos(-135, 77, -139)), - lineups = setOf(BlockPos(-102, 160, -110)) + lineups = setOf(BlockPos(-105, 149, -112)) ) to Colors.MINECRAFT_YELLOW, Lineup( - startPos = setOf(BlockPos(-131, 79, -114)), - lineups = setOf(BlockPos(-112, 155, -107)) + supply = SupplyPickUpSpot.XSafe, + startPos = setOf(BlockPos(-135, 78, -129)), + lineups = setOf(BlockPos(-109, 157, -105)) + ) to Colors.MINECRAFT_GOLD, + Lineup( + supply = SupplyPickUpSpot.xCannon, + startPos = setOf(BlockPos(-131, 78, -115)), + lineups = setOf(BlockPos(-109, 163, -105)) ) to Colors.WHITE, - // Square Lineup( + supply = SupplyPickUpSpot.xCannonStair, + startPos = setOf(BlockPos(-135, 76, -124)), + lineups = setOf(BlockPos(-109, 155, -105)) + ) to Colors.MINECRAFT_GRAY, + Lineup( + supply = SupplyPickUpSpot.Square, startPos = setOf(BlockPos(-141, 78, -91)), lineups = setOf( - BlockPos(-110, 155, -106), // cannon - BlockPos(-46, 120, -150), // X - BlockPos(-46, 135, -139), // shop - BlockPos(-37, 139, -125), // triangle - BlockPos(-28, 128, -112), // equals - BlockPos(-106, 157, -99) // slash + BlockPos(-109, 155, -105), // XCannon + BlockPos(-105, 150, -112), // X + BlockPos(-97, 105, -111), // shop + BlockPos(-93, 107, -105), // triangle + BlockPos(-97, 97, -98), // equals + BlockPos(-105, 155, -98) // slash ) ) to Colors.MINECRAFT_AQUA, - // equals Lineup( - startPos = setOf(BlockPos(-66, 76, -88)), - lineups = setOf(BlockPos(-101, 160, -100)) + supply = SupplyPickUpSpot.SquareLow, + startPos = setOf(BlockPos(-142, 77, -87)), + lineups = setOf( + BlockPos(-109, 151, -105), // XCannon + BlockPos(-105, 99, -112), // X + BlockPos(-97, 126, -112), // Shop + BlockPos(-93, 127, -105), // Triangle + BlockPos(-97, 102, -98), // Equals + BlockPos(-105, 149, -98) // Slash + ) + ) to Colors.MINECRAFT_DARK_AQUA, + Lineup( + supply = SupplyPickUpSpot.Equals, + startPos = setOf(BlockPos(-66, 76, -87)), + lineups = setOf(BlockPos(-97, 153, -98)) ) to Colors.MINECRAFT_GREEN, - // slash Lineup( - startPos = setOf(BlockPos(-114, 77, -69)), - lineups = setOf(BlockPos(-106, 157, -99), BlockPos(-138, 145, -88)) + supply = SupplyPickUpSpot.Slash, + startPos = setOf(BlockPos(-113, 77, -69)), + lineups = setOf(BlockPos(-105, 157, -99)) ) to Colors.MINECRAFT_BLUE ) private val blockNameMap = hashMapOf( - SupplyPickUpSpot.xCannon to BlockPos(-110, 155, -106), - SupplyPickUpSpot.X to BlockPos(-46, 120, -150), - SupplyPickUpSpot.Shop to BlockPos(-46, 135, -139), - SupplyPickUpSpot.Triangle to BlockPos(-37, 139, -125), - SupplyPickUpSpot.Equals to BlockPos(-28, 128, -112), - SupplyPickUpSpot.Slash to BlockPos(-106, 157, -99) + SupplyPickUpSpot.xCannon to BlockPos(-109, 155, -105), + SupplyPickUpSpot.X to BlockPos(-105, 150, -112), + SupplyPickUpSpot.Shop to BlockPos(-97, 105, -111), + SupplyPickUpSpot.Triangle to BlockPos(-93, 107, -105), + SupplyPickUpSpot.Equals to BlockPos(-97, 97, -98), + SupplyPickUpSpot.Slash to BlockPos(-105, 155, -98) ) + private var prioLineup = emptyList() + private var prioColor = Colors.TRANSPARENT + private fun cratePriorityPearl(closestSupplyPickUpSpot: SupplyPickUpSpot) { + when (closestSupplyPickUpSpot) { + SupplyPickUpSpot.X -> when (NoPre.prio) { + SupplyPickUpSpot.xCannon -> { + prioLineup = listOf(BlockPos(-130, 160, -114), BlockPos(-109, 155, -105)) + prioColor = Colors.WHITE + } + SupplyPickUpSpot.Square -> { + prioLineup = listOf(BlockPos(-142, 152, -179)) + prioColor = Colors.MINECRAFT_AQUA + } + else -> { + prioLineup = emptyList() + prioColor = Colors.TRANSPARENT + } + } + + SupplyPickUpSpot.Triangle -> when (NoPre.prio) { + SupplyPickUpSpot.Shop -> { + prioLineup = listOf(BlockPos(-74, 152, -134)) + prioColor = Colors.MINECRAFT_RED + } + SupplyPickUpSpot.xCannon -> { + prioLineup = listOf(BlockPos(-121, 121, -120)) + prioColor = Colors.WHITE + } + else -> { + prioLineup = emptyList() + prioColor = Colors.TRANSPARENT + } + } + + SupplyPickUpSpot.Equals -> when (NoPre.prio) { + SupplyPickUpSpot.Shop -> { + prioLineup = listOf(BlockPos(-76, 126, -134)) + prioColor = Colors.MINECRAFT_RED + } + // TODO: Add pearl waypoint for Equals to Square + else -> { + prioLineup = emptyList() + prioColor = Colors.TRANSPARENT + } + } + + SupplyPickUpSpot.Slash -> when (NoPre.prio) { + SupplyPickUpSpot.Square -> { + prioLineup = listOf(BlockPos(-140, 155, -87)) + prioColor = Colors.MINECRAFT_AQUA + } + SupplyPickUpSpot.xCannon -> { + prioLineup = listOf(BlockPos(-133, 157, -131)) + prioColor = Colors.WHITE + } + else -> { + prioLineup = emptyList() + prioColor = Colors.TRANSPARENT + } + } + + else -> { + prioLineup = emptyList() + prioColor = Colors.TRANSPARENT + } + + } + } + @SubscribeEvent fun onRender(event: RenderWorldLastEvent) { if (!KuudraUtils.inKuudra || KuudraUtils.phase != 1) return - var closest = true + var closestSupplyPickUpSpot = SupplyPickUpSpot.None + val closest = true getOrderedLineups(mc.thePlayer.position).forEach { (lineup, color) -> lineup.startPos.forEach { Renderer.drawBox(aabb = it.toAABB(), color = color, outlineWidth = if (!closest && hideFarWaypoints) 1f else 3f, @@ -89,7 +190,14 @@ object PearlWaypoints : Module( if (lineup.startPos != setOf(BlockPos(-141, 78, -91)) || blockNameMap[NoPre.missing] == it) Renderer.drawBox(aabb = it.toAABB(), color = color, outlineAlpha = 0f, fillAlpha = if (!closest && hideFarWaypoints) 0f else 3f, depth = false) } - closest = false + if (closest) closestSupplyPickUpSpot = lineup.supply + } + if (!showPriorityWaypoints) return + prioLineup = emptyList() + prioColor = Colors.TRANSPARENT + cratePriorityPearl(closestSupplyPickUpSpot) + prioLineup.forEach { + Renderer.drawBox(it.toAABB(), prioColor, outlineAlpha = 0f, fillAlpha = 3f, depth = false) } } @@ -101,5 +209,5 @@ object PearlWaypoints : Module( ) } - private data class Lineup(val startPos: Set, val lineups: Set) + private data class Lineup(val supply: SupplyPickUpSpot, val startPos: Set, val lineups: Set) } \ No newline at end of file diff --git a/src/main/kotlin/me/odinmain/utils/skyblock/KuudraUtils.kt b/src/main/kotlin/me/odinmain/utils/skyblock/KuudraUtils.kt index 73f8fdbb3..98e95a035 100644 --- a/src/main/kotlin/me/odinmain/utils/skyblock/KuudraUtils.kt +++ b/src/main/kotlin/me/odinmain/utils/skyblock/KuudraUtils.kt @@ -143,11 +143,15 @@ object KuudraUtils { enum class SupplyPickUpSpot(val location: Vec3) { Triangle(Vec3(-67.5, 77.0, -122.5)), X(Vec3(-142.5, 77.0, -151.0)), + XSafe(Vec3(-135.0, 78.0, -129.0)), Equals(Vec3(-65.5, 76.0, -87.5)), Slash(Vec3(-113.5, 77.0, -68.5)), Shop(Vec3(-81.0, 76.0, -143.0)), + ShopCorner(Vec3(-71.0, 79.0, -135.0)), xCannon(Vec3(-143.0, 76.0, -125.0)), + xCannonStair(Vec3(-135.0, 76.0, -124.0)), Square(Vec3(-143.0, 76.0, -80.0)), + SquareLow(Vec3(-142.0, 77.0, -87.0)), None(Vec3(0.0, 0.0, 0.0)) } } \ No newline at end of file From 6697a9e012652e4cb516edfa0b7d5b96152d3766 Mon Sep 17 00:00:00 2001 From: Jordyrat Date: Fri, 16 May 2025 22:13:54 +0100 Subject: [PATCH 2/7] Unused import --- .../kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt b/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt index 7a5b61a50..40becee26 100644 --- a/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt +++ b/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt @@ -1,6 +1,5 @@ package me.odinmain.features.impl.nether -import jdk.nashorn.internal.ir.Block import me.odinmain.features.Module import me.odinmain.features.settings.Setting.Companion.withDependency import me.odinmain.features.settings.impl.BooleanSetting From 2c4acb9f8b64c077d12b97093977fc6c19f28510 Mon Sep 17 00:00:00 2001 From: Jordyrat Date: Sat, 17 May 2025 21:44:32 +0100 Subject: [PATCH 3/7] cleanup and add dynamic waypoints (only for supply placement spots) --- .../features/impl/nether/PearlWaypoints.kt | 238 ++++++++++++------ .../features/impl/nether/SupplyHelper.kt | 2 +- 2 files changed, 162 insertions(+), 78 deletions(-) diff --git a/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt b/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt index 40becee26..de82f8a15 100644 --- a/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt +++ b/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt @@ -7,56 +7,84 @@ import me.odinmain.utils.render.Color import me.odinmain.utils.render.Renderer import me.odinmain.utils.skyblock.KuudraUtils import me.odinmain.utils.skyblock.KuudraUtils.SupplyPickUpSpot +import me.odinmain.utils.skyblock.PlayerUtils.posX +import me.odinmain.utils.skyblock.PlayerUtils.posY +import me.odinmain.utils.skyblock.PlayerUtils.posZ import me.odinmain.utils.toAABB +import me.odinmain.utils.toBlockPos import me.odinmain.utils.ui.Colors import net.minecraft.util.BlockPos +import net.minecraft.util.Vec3 import net.minecraft.util.Vec3i import net.minecraftforge.client.event.RenderWorldLastEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.* +import kotlin.math.PI +import kotlin.math.atan +import kotlin.math.atan2 +import kotlin.math.cos +import kotlin.math.sin +import kotlin.math.sqrt object PearlWaypoints : Module( name = "Pearl Waypoints", desc = "Renders waypoints for pearls in Kuudra." ) { private val hideFarWaypoints by BooleanSetting("Hide Far Waypoints", true, desc = "Hides the waypoints that are not the closest to you.") + private val dynamicPearlWaypoints by BooleanSetting("Dynamic Peal Waypoints", true, "Changes pearl waypoints to change based on where you are stood.") private val showPriorityWaypoints by BooleanSetting("Show Priority Waypoints", false, "Shows waypoints to land at your priority crate.").withDependency { hideFarWaypoints } + private val supplyNameMap = mapOf( + SupplyPickUpSpot.xCannon to BlockPos(-110.0, 78.0, -106.0), + SupplyPickUpSpot.X to BlockPos(-106.0, 78.0, -112.0), + SupplyPickUpSpot.Shop to BlockPos(-98.0, 78.0, -112.0), + SupplyPickUpSpot.Triangle to BlockPos(-94.0, 78.0, -106.0), + SupplyPickUpSpot.Equals to BlockPos(-98.0, 78.0, -99.0), + SupplyPickUpSpot.Slash to BlockPos(-106.0, 78.0, -99.0) + ) + private val pearlLineups: Map = mapOf( Lineup( supply = SupplyPickUpSpot.ShopCorner, startPos = setOf(BlockPos(-71, 79, -135)), - lineups = setOf(BlockPos(0, 0, 0)) + lineups = setOf(BlockPos(0, 0, 0)), + endPos = setOf(supplyNameMap[SupplyPickUpSpot.Shop] !!) ) to Colors.MINECRAFT_DARK_RED, Lineup( supply = SupplyPickUpSpot.Shop, startPos = setOf(BlockPos(-86, 78, -129)), - lineups = setOf(BlockPos(-97, 159, -112)) + lineups = setOf(BlockPos(-97, 159, -112)), + endPos = setOf(supplyNameMap[SupplyPickUpSpot.Shop] !!) ) to Colors.MINECRAFT_RED, Lineup( supply = SupplyPickUpSpot.Triangle, startPos = setOf(BlockPos(-68, 77, -123)), - lineups = setOf(BlockPos(-93, 155, -105)) + lineups = setOf(BlockPos(-93, 155, -105)), + endPos = setOf(supplyNameMap[SupplyPickUpSpot.Triangle] !!) ) to Colors.MINECRAFT_LIGHT_PURPLE, Lineup( supply = SupplyPickUpSpot.X, startPos = setOf(BlockPos(-135, 77, -139)), - lineups = setOf(BlockPos(-105, 149, -112)) + lineups = setOf(BlockPos(-105, 149, -112)), + endPos = setOf(supplyNameMap[SupplyPickUpSpot.X] !!) ) to Colors.MINECRAFT_YELLOW, Lineup( supply = SupplyPickUpSpot.XSafe, startPos = setOf(BlockPos(-135, 78, -129)), - lineups = setOf(BlockPos(-109, 157, -105)) + lineups = setOf(BlockPos(-109, 157, -105)), + endPos = setOf(supplyNameMap[SupplyPickUpSpot.X] !!) ) to Colors.MINECRAFT_GOLD, Lineup( supply = SupplyPickUpSpot.xCannon, startPos = setOf(BlockPos(-131, 78, -115)), - lineups = setOf(BlockPos(-109, 163, -105)) + lineups = setOf(BlockPos(-109, 163, -105)), + endPos = setOf(supplyNameMap[SupplyPickUpSpot.xCannon] !!) ) to Colors.WHITE, Lineup( supply = SupplyPickUpSpot.xCannonStair, startPos = setOf(BlockPos(-135, 76, -124)), - lineups = setOf(BlockPos(-109, 155, -105)) + lineups = setOf(BlockPos(-109, 155, -105)), + endPos = setOf(supplyNameMap[SupplyPickUpSpot.xCannon] !!) ) to Colors.MINECRAFT_GRAY, Lineup( supply = SupplyPickUpSpot.Square, @@ -64,11 +92,12 @@ object PearlWaypoints : Module( lineups = setOf( BlockPos(-109, 155, -105), // XCannon BlockPos(-105, 150, -112), // X - BlockPos(-97, 105, -111), // shop - BlockPos(-93, 107, -105), // triangle - BlockPos(-97, 97, -98), // equals - BlockPos(-105, 155, -98) // slash - ) + BlockPos(-97, 105, -111), // Shop + BlockPos(-93, 107, -105), // Triangle + BlockPos(-97, 97, -98), // Equals + BlockPos(-105, 155, -98) // Slash + ), + endPos = setOf(supplyNameMap[NoPre.missing] !!) ) to Colors.MINECRAFT_AQUA, Lineup( supply = SupplyPickUpSpot.SquareLow, @@ -80,17 +109,20 @@ object PearlWaypoints : Module( BlockPos(-93, 127, -105), // Triangle BlockPos(-97, 102, -98), // Equals BlockPos(-105, 149, -98) // Slash - ) + ), + endPos = setOf(supplyNameMap[NoPre.missing] !!) ) to Colors.MINECRAFT_DARK_AQUA, Lineup( supply = SupplyPickUpSpot.Equals, startPos = setOf(BlockPos(-66, 76, -87)), - lineups = setOf(BlockPos(-97, 153, -98)) + lineups = setOf(BlockPos(-97, 153, -98)), + endPos = setOf(supplyNameMap[SupplyPickUpSpot.Equals] !!) ) to Colors.MINECRAFT_GREEN, Lineup( supply = SupplyPickUpSpot.Slash, startPos = setOf(BlockPos(-113, 77, -69)), - lineups = setOf(BlockPos(-105, 157, -99)) + lineups = setOf(BlockPos(-105, 157, -99)), + endPos = setOf(supplyNameMap[SupplyPickUpSpot.Slash] !!) ) to Colors.MINECRAFT_BLUE ) @@ -103,73 +135,93 @@ object PearlWaypoints : Module( SupplyPickUpSpot.Slash to BlockPos(-105, 155, -98) ) - private var prioLineup = emptyList() - private var prioColor = Colors.TRANSPARENT - private fun cratePriorityPearl(closestSupplyPickUpSpot: SupplyPickUpSpot) { - when (closestSupplyPickUpSpot) { + private fun cratePriorityPearl(closestSupplyPickUpSpot: SupplyPickUpSpot): Pair, Color> { + return when (closestSupplyPickUpSpot) { SupplyPickUpSpot.X -> when (NoPre.prio) { - SupplyPickUpSpot.xCannon -> { - prioLineup = listOf(BlockPos(-130, 160, -114), BlockPos(-109, 155, -105)) - prioColor = Colors.WHITE - } - SupplyPickUpSpot.Square -> { - prioLineup = listOf(BlockPos(-142, 152, -179)) - prioColor = Colors.MINECRAFT_AQUA - } - else -> { - prioLineup = emptyList() - prioColor = Colors.TRANSPARENT - } + SupplyPickUpSpot.xCannon -> listOf(BlockPos(-130, 160, -114), BlockPos(-109, 155, -105)) to Colors.WHITE + SupplyPickUpSpot.Square -> listOf(BlockPos(-142, 152, -179)) to Colors.MINECRAFT_AQUA + else -> emptyList() to Colors.TRANSPARENT } SupplyPickUpSpot.Triangle -> when (NoPre.prio) { - SupplyPickUpSpot.Shop -> { - prioLineup = listOf(BlockPos(-74, 152, -134)) - prioColor = Colors.MINECRAFT_RED - } - SupplyPickUpSpot.xCannon -> { - prioLineup = listOf(BlockPos(-121, 121, -120)) - prioColor = Colors.WHITE - } - else -> { - prioLineup = emptyList() - prioColor = Colors.TRANSPARENT - } + SupplyPickUpSpot.Shop -> listOf(BlockPos(-74, 152, -134)) to Colors.MINECRAFT_RED + SupplyPickUpSpot.xCannon -> listOf(BlockPos(-121, 121, -120)) to Colors.WHITE + else -> emptyList() to Colors.TRANSPARENT } SupplyPickUpSpot.Equals -> when (NoPre.prio) { - SupplyPickUpSpot.Shop -> { - prioLineup = listOf(BlockPos(-76, 126, -134)) - prioColor = Colors.MINECRAFT_RED - } + SupplyPickUpSpot.Shop -> listOf(BlockPos(-76, 126, -134)) to Colors.MINECRAFT_RED // TODO: Add pearl waypoint for Equals to Square - else -> { - prioLineup = emptyList() - prioColor = Colors.TRANSPARENT - } + else -> emptyList() to Colors.TRANSPARENT } SupplyPickUpSpot.Slash -> when (NoPre.prio) { - SupplyPickUpSpot.Square -> { - prioLineup = listOf(BlockPos(-140, 155, -87)) - prioColor = Colors.MINECRAFT_AQUA - } - SupplyPickUpSpot.xCannon -> { - prioLineup = listOf(BlockPos(-133, 157, -131)) - prioColor = Colors.WHITE - } - else -> { - prioLineup = emptyList() - prioColor = Colors.TRANSPARENT - } + SupplyPickUpSpot.Square -> listOf(BlockPos(-140, 155, -87)) to Colors.MINECRAFT_AQUA + SupplyPickUpSpot.xCannon -> listOf(BlockPos(-133, 157, -131)) to Colors.WHITE + else -> emptyList() to Colors.TRANSPARENT } - else -> { - prioLineup = emptyList() - prioColor = Colors.TRANSPARENT - } + else -> emptyList() to Colors.TRANSPARENT + } + } + private const val RAD_TO_DEG = 180.0 / PI + private const val DEG_TO_RAD = PI / 180.0 + private const val EVEL = 1.67 + private const val GRAV = 0.08 + + fun calculatePearl(landingX: Double, landingY: Double, landingZ: Double): Vec3? { + val playerX = posX + val playerY = posY + val playerZ = posZ + + val offX = landingX - posX + val offZ = landingZ - posZ + val offXSq = offX * offX + val offZSq = offZ * offZ + val offHorSq = offXSq + offZSq + + if (offHorSq > 10000) return null + + val offY = landingY - (playerY + 1.62) + val offHor = sqrt(offHorSq) + + val vSq = EVEL * EVEL + val gravHorSq = GRAV * offHorSq + val term1 = gravHorSq / (2 * vSq) + val discrim = vSq - GRAV * (term1 - offY) + + if (discrim < 0) return null + + val sqrtDiscrim = sqrt(discrim) + val atanFactor = GRAV * offHor + + val vPlusSqrt = (vSq + sqrtDiscrim) / atanFactor + val angle1 = atan(vPlusSqrt) * RAD_TO_DEG + + val angle = if (angle1 >= 45.0) angle1 + else { + val angle2 = atan((vSq - sqrtDiscrim) / atanFactor) * RAD_TO_DEG + if (angle2 >= 45.0) angle2 else return null + } + + val dragAng = when { + offHor < 10 -> 1.0 + offHor < 28 -> 1.026 - (offHor - 10) * 0.000944 + offHor < 36 -> 1.033 - (offHor - 28) * 0.00275 + offHor < 45 -> 0.982 + else -> 1.0 - (offHor - 40) * 0.008 } + + val radP = -(angle * dragAng) * DEG_TO_RAD + val radY = -atan2(offX, offZ) + val cosRadP = cos(radP) + + return Vec3( + playerX - cosRadP * sin(radY) * 10, + playerY - sin(radP) * 10, + playerZ + cosRadP * cos(radY) * 10 + ) } @SubscribeEvent @@ -177,24 +229,56 @@ object PearlWaypoints : Module( if (!KuudraUtils.inKuudra || KuudraUtils.phase != 1) return var closestSupplyPickUpSpot = SupplyPickUpSpot.None - val closest = true + var closest = true getOrderedLineups(mc.thePlayer.position).forEach { (lineup, color) -> lineup.startPos.forEach { Renderer.drawBox(aabb = it.toAABB(), color = color, outlineWidth = if (!closest && hideFarWaypoints) 1f else 3f, outlineAlpha = if (!closest && hideFarWaypoints) 0.25f else 1f, fillAlpha = 0f, depth = false) } - lineup.lineups.forEach lineupLoop@{ - if (NoPre.missing == SupplyPickUpSpot.None || NoPre.missing == SupplyPickUpSpot.Square) - return@lineupLoop Renderer.drawBox(aabb = it.toAABB(), color = color, outlineAlpha = 0f, fillAlpha = if (!closest && hideFarWaypoints) 0f else 3f, depth = false) - if (lineup.startPos != setOf(BlockPos(-141, 78, -91)) || blockNameMap[NoPre.missing] == it) - Renderer.drawBox(aabb = it.toAABB(), color = color, outlineAlpha = 0f, fillAlpha = if (!closest && hideFarWaypoints) 0f else 3f, depth = false) + if (!dynamicPearlWaypoints) { + lineup.lineups.forEach lineupLoop@{ + if (NoPre.missing == SupplyPickUpSpot.None || NoPre.missing == SupplyPickUpSpot.Square) + return@lineupLoop Renderer.drawBox( + aabb = it.toAABB(), + color = color, + outlineAlpha = 0f, + fillAlpha = if (!closest && hideFarWaypoints) 0f else 3f, + depth = false + ) + if (lineup.startPos != setOf(BlockPos(-141, 78, -91)) || blockNameMap[NoPre.missing] == it) + Renderer.drawBox( + aabb = it.toAABB(), + color = color, + outlineAlpha = 0f, + fillAlpha = if (!closest && hideFarWaypoints) 0f else 3f, + depth = false + ) + } + } else { + lineup.endPos.forEach lineupLoop@{ + if (NoPre.missing == SupplyPickUpSpot.None || NoPre.missing == SupplyPickUpSpot.Square) + return@lineupLoop Renderer.drawBox( + aabb = calculatePearl(it.x.toDouble(), it.y.toDouble(), it.z.toDouble())?.toAABB() ?: return@lineupLoop, + color = color, + outlineAlpha = 0f, + fillAlpha = if (!closest && hideFarWaypoints) 0f else 3f, + depth = false + ) + if (lineup.startPos != setOf(BlockPos(-141, 78, -91)) || blockNameMap[NoPre.missing] == it) + Renderer.drawBox( + aabb = calculatePearl(it.x.toDouble(), it.y.toDouble(), it.z.toDouble())?.toAABB() ?: return@lineupLoop, + color = color, + outlineAlpha = 0f, + fillAlpha = if (!closest && hideFarWaypoints) 0f else 3f, + depth = false + ) + } } if (closest) closestSupplyPickUpSpot = lineup.supply + closest = false } if (!showPriorityWaypoints) return - prioLineup = emptyList() - prioColor = Colors.TRANSPARENT - cratePriorityPearl(closestSupplyPickUpSpot) + val (prioLineup, prioColor) = cratePriorityPearl(closestSupplyPickUpSpot) prioLineup.forEach { Renderer.drawBox(it.toAABB(), prioColor, outlineAlpha = 0f, fillAlpha = 3f, depth = false) } @@ -208,5 +292,5 @@ object PearlWaypoints : Module( ) } - private data class Lineup(val supply: SupplyPickUpSpot, val startPos: Set, val lineups: Set) + private data class Lineup(val supply: SupplyPickUpSpot, val startPos: Set, val endPos: Set, val lineups: Set) } \ No newline at end of file diff --git a/src/main/kotlin/me/odinmain/features/impl/nether/SupplyHelper.kt b/src/main/kotlin/me/odinmain/features/impl/nether/SupplyHelper.kt index b05fee345..e76559e87 100644 --- a/src/main/kotlin/me/odinmain/features/impl/nether/SupplyHelper.kt +++ b/src/main/kotlin/me/odinmain/features/impl/nether/SupplyHelper.kt @@ -69,7 +69,7 @@ object SupplyHelper : Module( Pair(Vec3(-98.0, 78.0, -112.0), SupplyPickUpSpot.Shop), Pair(Vec3(-98.0, 78.0, -99.0), SupplyPickUpSpot.Equals), Pair(Vec3(-110.0, 78.0, -106.0), SupplyPickUpSpot.xCannon), - Pair(Vec3(-106.0, 78.0, -112.0), SupplyPickUpSpot.X ), + Pair(Vec3(-106.0, 78.0, -112.0), SupplyPickUpSpot.X), Pair(Vec3(-94.0, 78.0, -106.0), SupplyPickUpSpot.Triangle), Pair(Vec3(-106.0, 78.0, -99.0), SupplyPickUpSpot.Slash), ) From 1a009023c347eb7178c99d5480a4d671cf3bcf51 Mon Sep 17 00:00:00 2001 From: Jordyrat Date: Sat, 17 May 2025 21:57:14 +0100 Subject: [PATCH 4/7] Credit calculatePearl function --- .../kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt b/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt index de82f8a15..40f3c3e8a 100644 --- a/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt +++ b/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt @@ -170,6 +170,7 @@ object PearlWaypoints : Module( private const val EVEL = 1.67 private const val GRAV = 0.08 + // Made by Aidanmao fun calculatePearl(landingX: Double, landingY: Double, landingZ: Double): Vec3? { val playerX = posX val playerY = posY From c6958c1d718e4969365b6bcf020a2561c682e5a0 Mon Sep 17 00:00:00 2001 From: Jordyrat Date: Sun, 18 May 2025 00:20:58 +0100 Subject: [PATCH 5/7] Fix NullPointError Crash --- .../odinmain/features/impl/nether/PearlWaypoints.kt | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt b/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt index 40f3c3e8a..73d8f68f7 100644 --- a/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt +++ b/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt @@ -11,7 +11,6 @@ import me.odinmain.utils.skyblock.PlayerUtils.posX import me.odinmain.utils.skyblock.PlayerUtils.posY import me.odinmain.utils.skyblock.PlayerUtils.posZ import me.odinmain.utils.toAABB -import me.odinmain.utils.toBlockPos import me.odinmain.utils.ui.Colors import net.minecraft.util.BlockPos import net.minecraft.util.Vec3 @@ -19,12 +18,7 @@ import net.minecraft.util.Vec3i import net.minecraftforge.client.event.RenderWorldLastEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.* -import kotlin.math.PI -import kotlin.math.atan -import kotlin.math.atan2 -import kotlin.math.cos -import kotlin.math.sin -import kotlin.math.sqrt +import kotlin.math.* object PearlWaypoints : Module( name = "Pearl Waypoints", @@ -40,7 +34,8 @@ object PearlWaypoints : Module( SupplyPickUpSpot.Shop to BlockPos(-98.0, 78.0, -112.0), SupplyPickUpSpot.Triangle to BlockPos(-94.0, 78.0, -106.0), SupplyPickUpSpot.Equals to BlockPos(-98.0, 78.0, -99.0), - SupplyPickUpSpot.Slash to BlockPos(-106.0, 78.0, -99.0) + SupplyPickUpSpot.Slash to BlockPos(-106.0, 78.0, -99.0), + SupplyPickUpSpot.None to BlockPos(0, 0, 0) ) private val pearlLineups: Map = mapOf( From 81f67bb4b2cb24038bfde51121e3192662c63e43 Mon Sep 17 00:00:00 2001 From: Jordyrat Date: Mon, 19 May 2025 19:42:18 +0100 Subject: [PATCH 6/7] Requested Changes --- .../me/odinmain/features/impl/nether/NoPre.kt | 175 ++++-------------- .../features/impl/nether/PearlWaypoints.kt | 26 +-- 2 files changed, 46 insertions(+), 155 deletions(-) diff --git a/src/main/kotlin/me/odinmain/features/impl/nether/NoPre.kt b/src/main/kotlin/me/odinmain/features/impl/nether/NoPre.kt index ca81b2e8f..c654ebede 100644 --- a/src/main/kotlin/me/odinmain/features/impl/nether/NoPre.kt +++ b/src/main/kotlin/me/odinmain/features/impl/nether/NoPre.kt @@ -67,7 +67,8 @@ object NoPre : Module( onMessage(Regex("^Party > (\\[[^]]*?])? ?(\\w{1,16}): No ?(Triangle|X|Equals|Slash|xCannon|Square|Shop)!\$")) { missing = SupplyPickUpSpot.valueOf(it.groupValues.lastOrNull() ?: return@onMessage) if (!showCratePriority) return@onMessage - val cratePriority = cratePriority(missing).ifEmpty { return@onMessage } + val (prio, cratePriority) = cratePriority(missing) + cratePriority.ifEmpty { return@onMessage } PlayerUtils.alert(cratePriority, time = cratePriorityTitleTime) modMessage("Crate Priority: $cratePriority") } @@ -78,176 +79,66 @@ object NoPre : Module( } } - private fun cratePriority(missing: SupplyPickUpSpot): String { + private fun cratePriority(missing: SupplyPickUpSpot): Pair { return when (missing) { // Shop Missing SupplyPickUpSpot.Shop -> when (preSpot) { - SupplyPickUpSpot.Triangle, SupplyPickUpSpot.X -> { - prio = SupplyPickUpSpot.xCannon - "Go X Cannon" - } - SupplyPickUpSpot.Equals, SupplyPickUpSpot.Slash -> { - prio = SupplyPickUpSpot.Square - "Go Square, place on Shop" - } - else -> { - prio = SupplyPickUpSpot.None - "" - } + SupplyPickUpSpot.Triangle, SupplyPickUpSpot.X -> SupplyPickUpSpot.xCannon to "Go X Cannon" + SupplyPickUpSpot.Equals, SupplyPickUpSpot.Slash -> SupplyPickUpSpot.Square to "Go Square, place on Shop" + else -> SupplyPickUpSpot.None to "" } // Triangle Missing SupplyPickUpSpot.Triangle -> when (preSpot) { - SupplyPickUpSpot.Triangle -> { - prio = SupplyPickUpSpot.None - if (advanced) "Pull Square and X Cannon. Next: collect Shop" else "Pull Square. Next: collect Shop" - } - SupplyPickUpSpot.X -> { - prio = SupplyPickUpSpot.xCannon - "Go X Cannon" - } - SupplyPickUpSpot.Equals -> { - if (advanced) { - prio = SupplyPickUpSpot.Shop - "Go Shop" - } else { - prio = SupplyPickUpSpot.xCannon - "Go X Cannon" - } - } - SupplyPickUpSpot.Slash -> { - prio = SupplyPickUpSpot.Square - "Go Square, place on Triangle" - } - else -> { - prio = SupplyPickUpSpot.None - "" - } + SupplyPickUpSpot.Triangle -> SupplyPickUpSpot.None to if (advanced) "Pull Square and X Cannon. Next: collect Shop" else "Pull Square. Next: collect Shop" + SupplyPickUpSpot.X -> SupplyPickUpSpot.xCannon to "Go X Cannon" + SupplyPickUpSpot.Equals -> if (advanced) SupplyPickUpSpot.Shop to "Go Shop" else SupplyPickUpSpot.xCannon to "Go X Cannon" + SupplyPickUpSpot.Slash -> SupplyPickUpSpot.Square to "Go Square, place on Triangle" + else -> SupplyPickUpSpot.None to "" } // Equals Missing SupplyPickUpSpot.Equals -> when (preSpot) { - SupplyPickUpSpot.Triangle -> { - if (advanced) { - prio = SupplyPickUpSpot.Shop - "Go Shop" - } else { - prio = SupplyPickUpSpot.xCannon - "Go X Cannon" - } - } - SupplyPickUpSpot.X -> { - prio = SupplyPickUpSpot.xCannon - "Go X Cannon" - } - SupplyPickUpSpot.Equals -> { - prio = SupplyPickUpSpot.Shop - if (advanced) "Pull Square and X Cannon. Next: collect Shop" else "Pull Square. Next: collect Shop" - } - SupplyPickUpSpot.Slash -> { - prio = SupplyPickUpSpot.Square - "Go Square, place on Equals" - } - else -> { - prio = SupplyPickUpSpot.None - "" - } + SupplyPickUpSpot.Triangle -> if (advanced) SupplyPickUpSpot.Shop to "Go Shop" else SupplyPickUpSpot.xCannon to "Go X Cannon" + SupplyPickUpSpot.X -> SupplyPickUpSpot.xCannon to "Go X Cannon" + SupplyPickUpSpot.Equals -> SupplyPickUpSpot.Shop to if (advanced) "Pull Square and X Cannon. Next: collect Shop" else "Pull Square. Next: collect Shop" + SupplyPickUpSpot.Slash -> SupplyPickUpSpot.Square to "Go Square, place on Equals" + else -> SupplyPickUpSpot.None to "" } // Slash Missing SupplyPickUpSpot.Slash -> when (preSpot) { - SupplyPickUpSpot.Triangle -> { - prio = SupplyPickUpSpot.Square - "Go Square, place on Slash" - } - SupplyPickUpSpot.X -> { - prio = SupplyPickUpSpot.xCannon - "Go X Cannon" - } - SupplyPickUpSpot.Equals -> { - if (advanced) { - prio = SupplyPickUpSpot.Shop - "Go Shop" - } else { - prio = SupplyPickUpSpot.xCannon - "Go X Cannon" - } - } - SupplyPickUpSpot.Slash -> { - prio = SupplyPickUpSpot.Shop - if (advanced) "Pull Square and X Cannon. Next: collect Shop" else "Pull Square. Next: collect Shop" - } - else -> { - prio = SupplyPickUpSpot.None - "" - } + SupplyPickUpSpot.Triangle -> SupplyPickUpSpot.Square to "Go Square, place on Slash" + SupplyPickUpSpot.X -> SupplyPickUpSpot.xCannon to "Go X Cannon" + SupplyPickUpSpot.Equals -> if (advanced) SupplyPickUpSpot.Shop to "Go Shop" else SupplyPickUpSpot.xCannon to "Go X Cannon" + SupplyPickUpSpot.Slash -> SupplyPickUpSpot.Shop to if (advanced) "Pull Square and X Cannon. Next: collect Shop" else "Pull Square. Next: collect Shop" + else -> SupplyPickUpSpot.None to "" } // Square Missing SupplyPickUpSpot.Square -> when (preSpot) { - SupplyPickUpSpot.Triangle, SupplyPickUpSpot.Equals -> { - prio = SupplyPickUpSpot.Shop - "Go Shop" - } - SupplyPickUpSpot.X, SupplyPickUpSpot.Slash -> { - prio = SupplyPickUpSpot.xCannon - "Go X Cannon" - } - else -> { - prio = SupplyPickUpSpot.None - "" - } + SupplyPickUpSpot.Triangle, SupplyPickUpSpot.Equals -> SupplyPickUpSpot.Shop to "Go Shop" + SupplyPickUpSpot.X, SupplyPickUpSpot.Slash -> SupplyPickUpSpot.xCannon to "Go X Cannon" + else -> SupplyPickUpSpot.None to "" } // X Cannon Missing SupplyPickUpSpot.xCannon -> when (preSpot) { - SupplyPickUpSpot.Triangle, SupplyPickUpSpot.Equals -> { - prio = SupplyPickUpSpot.Shop - "Go Shop" - } - SupplyPickUpSpot.Slash, SupplyPickUpSpot.X -> { - prio = SupplyPickUpSpot.Square - "Go Square, place on X Cannon" - } - else -> { - prio = SupplyPickUpSpot.None - "" - } + SupplyPickUpSpot.Triangle, SupplyPickUpSpot.Equals -> SupplyPickUpSpot.Shop to "Go Shop" + SupplyPickUpSpot.Slash, SupplyPickUpSpot.X -> SupplyPickUpSpot.Square to "Go Square, place on X Cannon" + else -> SupplyPickUpSpot.None to "" } // X Missing SupplyPickUpSpot.X -> when (preSpot) { - SupplyPickUpSpot.Triangle -> { - prio = SupplyPickUpSpot.xCannon - "Go X Cannon" - } - SupplyPickUpSpot.X -> { - prio = SupplyPickUpSpot.Shop - if (advanced) "Pull Square and X Cannon. Next: collect Shop" else "Pull Square. Next: collect Shop" - } - SupplyPickUpSpot.Equals -> { - if (advanced) { - prio = SupplyPickUpSpot.Shop - "Go Shop" - } else { - prio = SupplyPickUpSpot.xCannon - "Go X Cannon" - } - } - SupplyPickUpSpot.Slash -> { - prio = SupplyPickUpSpot.Square - "Go Square, place on X" - } - else -> { - prio = SupplyPickUpSpot.None - "" - } + SupplyPickUpSpot.Triangle -> SupplyPickUpSpot.xCannon to "Go X Cannon" + SupplyPickUpSpot.X -> SupplyPickUpSpot.Shop to if (advanced) "Pull Square and X Cannon. Next: collect Shop" else "Pull Square. Next: collect Shop" + SupplyPickUpSpot.Equals -> if (advanced) SupplyPickUpSpot.Shop to "Go Shop" else SupplyPickUpSpot.xCannon to "Go X Cannon" + SupplyPickUpSpot.Slash -> SupplyPickUpSpot.Square to "Go Square, place on X" + else -> SupplyPickUpSpot.None to "" } - else -> { - prio = SupplyPickUpSpot.None - "" - } + else -> SupplyPickUpSpot.None to "" } } } \ No newline at end of file diff --git a/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt b/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt index 73d8f68f7..642dbf6ce 100644 --- a/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt +++ b/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt @@ -30,11 +30,11 @@ object PearlWaypoints : Module( private val supplyNameMap = mapOf( SupplyPickUpSpot.xCannon to BlockPos(-110.0, 78.0, -106.0), - SupplyPickUpSpot.X to BlockPos(-106.0, 78.0, -112.0), - SupplyPickUpSpot.Shop to BlockPos(-98.0, 78.0, -112.0), SupplyPickUpSpot.Triangle to BlockPos(-94.0, 78.0, -106.0), SupplyPickUpSpot.Equals to BlockPos(-98.0, 78.0, -99.0), SupplyPickUpSpot.Slash to BlockPos(-106.0, 78.0, -99.0), + SupplyPickUpSpot.Shop to BlockPos(-98.0, 78.0, -112.0), + SupplyPickUpSpot.X to BlockPos(-106.0, 78.0, -112.0), SupplyPickUpSpot.None to BlockPos(0, 0, 0) ) @@ -43,43 +43,43 @@ object PearlWaypoints : Module( supply = SupplyPickUpSpot.ShopCorner, startPos = setOf(BlockPos(-71, 79, -135)), lineups = setOf(BlockPos(0, 0, 0)), - endPos = setOf(supplyNameMap[SupplyPickUpSpot.Shop] !!) + endPos = setOf(supplyNameMap[SupplyPickUpSpot.Shop] as BlockPos) ) to Colors.MINECRAFT_DARK_RED, Lineup( supply = SupplyPickUpSpot.Shop, startPos = setOf(BlockPos(-86, 78, -129)), lineups = setOf(BlockPos(-97, 159, -112)), - endPos = setOf(supplyNameMap[SupplyPickUpSpot.Shop] !!) + endPos = setOf(supplyNameMap[SupplyPickUpSpot.Shop] as BlockPos) ) to Colors.MINECRAFT_RED, Lineup( supply = SupplyPickUpSpot.Triangle, startPos = setOf(BlockPos(-68, 77, -123)), lineups = setOf(BlockPos(-93, 155, -105)), - endPos = setOf(supplyNameMap[SupplyPickUpSpot.Triangle] !!) + endPos = setOf(supplyNameMap[SupplyPickUpSpot.Triangle] as BlockPos) ) to Colors.MINECRAFT_LIGHT_PURPLE, Lineup( supply = SupplyPickUpSpot.X, startPos = setOf(BlockPos(-135, 77, -139)), lineups = setOf(BlockPos(-105, 149, -112)), - endPos = setOf(supplyNameMap[SupplyPickUpSpot.X] !!) + endPos = setOf(supplyNameMap[SupplyPickUpSpot.X] as BlockPos) ) to Colors.MINECRAFT_YELLOW, Lineup( supply = SupplyPickUpSpot.XSafe, startPos = setOf(BlockPos(-135, 78, -129)), lineups = setOf(BlockPos(-109, 157, -105)), - endPos = setOf(supplyNameMap[SupplyPickUpSpot.X] !!) + endPos = setOf(supplyNameMap[SupplyPickUpSpot.X] as BlockPos) ) to Colors.MINECRAFT_GOLD, Lineup( supply = SupplyPickUpSpot.xCannon, startPos = setOf(BlockPos(-131, 78, -115)), lineups = setOf(BlockPos(-109, 163, -105)), - endPos = setOf(supplyNameMap[SupplyPickUpSpot.xCannon] !!) + endPos = setOf(supplyNameMap[SupplyPickUpSpot.xCannon] as BlockPos) ) to Colors.WHITE, Lineup( supply = SupplyPickUpSpot.xCannonStair, startPos = setOf(BlockPos(-135, 76, -124)), lineups = setOf(BlockPos(-109, 155, -105)), - endPos = setOf(supplyNameMap[SupplyPickUpSpot.xCannon] !!) + endPos = setOf(supplyNameMap[SupplyPickUpSpot.xCannon] as BlockPos) ) to Colors.MINECRAFT_GRAY, Lineup( supply = SupplyPickUpSpot.Square, @@ -92,7 +92,7 @@ object PearlWaypoints : Module( BlockPos(-97, 97, -98), // Equals BlockPos(-105, 155, -98) // Slash ), - endPos = setOf(supplyNameMap[NoPre.missing] !!) + endPos = setOf(supplyNameMap[NoPre.missing] as BlockPos) ) to Colors.MINECRAFT_AQUA, Lineup( supply = SupplyPickUpSpot.SquareLow, @@ -105,19 +105,19 @@ object PearlWaypoints : Module( BlockPos(-97, 102, -98), // Equals BlockPos(-105, 149, -98) // Slash ), - endPos = setOf(supplyNameMap[NoPre.missing] !!) + endPos = setOf(supplyNameMap[NoPre.missing] as BlockPos) ) to Colors.MINECRAFT_DARK_AQUA, Lineup( supply = SupplyPickUpSpot.Equals, startPos = setOf(BlockPos(-66, 76, -87)), lineups = setOf(BlockPos(-97, 153, -98)), - endPos = setOf(supplyNameMap[SupplyPickUpSpot.Equals] !!) + endPos = setOf(supplyNameMap[SupplyPickUpSpot.Equals] as BlockPos) ) to Colors.MINECRAFT_GREEN, Lineup( supply = SupplyPickUpSpot.Slash, startPos = setOf(BlockPos(-113, 77, -69)), lineups = setOf(BlockPos(-105, 157, -99)), - endPos = setOf(supplyNameMap[SupplyPickUpSpot.Slash] !!) + endPos = setOf(supplyNameMap[SupplyPickUpSpot.Slash] as BlockPos) ) to Colors.MINECRAFT_BLUE ) From d4b7efa9437f494fae75204fd6f684fc64324b77 Mon Sep 17 00:00:00 2001 From: Jordyrat Date: Mon, 19 May 2025 19:49:14 +0100 Subject: [PATCH 7/7] Better Lineup --- .../features/impl/nether/PearlWaypoints.kt | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt b/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt index 642dbf6ce..88311e56a 100644 --- a/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt +++ b/src/main/kotlin/me/odinmain/features/impl/nether/PearlWaypoints.kt @@ -43,43 +43,43 @@ object PearlWaypoints : Module( supply = SupplyPickUpSpot.ShopCorner, startPos = setOf(BlockPos(-71, 79, -135)), lineups = setOf(BlockPos(0, 0, 0)), - endPos = setOf(supplyNameMap[SupplyPickUpSpot.Shop] as BlockPos) + endPos = setOfNotNull(supplyNameMap[SupplyPickUpSpot.Shop]) ) to Colors.MINECRAFT_DARK_RED, Lineup( supply = SupplyPickUpSpot.Shop, startPos = setOf(BlockPos(-86, 78, -129)), lineups = setOf(BlockPos(-97, 159, -112)), - endPos = setOf(supplyNameMap[SupplyPickUpSpot.Shop] as BlockPos) + endPos = setOfNotNull(supplyNameMap[SupplyPickUpSpot.Shop]) ) to Colors.MINECRAFT_RED, Lineup( supply = SupplyPickUpSpot.Triangle, startPos = setOf(BlockPos(-68, 77, -123)), lineups = setOf(BlockPos(-93, 155, -105)), - endPos = setOf(supplyNameMap[SupplyPickUpSpot.Triangle] as BlockPos) + endPos = setOfNotNull(supplyNameMap[SupplyPickUpSpot.Triangle]) ) to Colors.MINECRAFT_LIGHT_PURPLE, Lineup( supply = SupplyPickUpSpot.X, startPos = setOf(BlockPos(-135, 77, -139)), lineups = setOf(BlockPos(-105, 149, -112)), - endPos = setOf(supplyNameMap[SupplyPickUpSpot.X] as BlockPos) + endPos = setOfNotNull(supplyNameMap[SupplyPickUpSpot.X]) ) to Colors.MINECRAFT_YELLOW, Lineup( supply = SupplyPickUpSpot.XSafe, startPos = setOf(BlockPos(-135, 78, -129)), lineups = setOf(BlockPos(-109, 157, -105)), - endPos = setOf(supplyNameMap[SupplyPickUpSpot.X] as BlockPos) + endPos = setOfNotNull(supplyNameMap[SupplyPickUpSpot.X]) ) to Colors.MINECRAFT_GOLD, Lineup( supply = SupplyPickUpSpot.xCannon, startPos = setOf(BlockPos(-131, 78, -115)), lineups = setOf(BlockPos(-109, 163, -105)), - endPos = setOf(supplyNameMap[SupplyPickUpSpot.xCannon] as BlockPos) + endPos = setOfNotNull(supplyNameMap[SupplyPickUpSpot.xCannon]) ) to Colors.WHITE, Lineup( supply = SupplyPickUpSpot.xCannonStair, startPos = setOf(BlockPos(-135, 76, -124)), lineups = setOf(BlockPos(-109, 155, -105)), - endPos = setOf(supplyNameMap[SupplyPickUpSpot.xCannon] as BlockPos) + endPos = setOfNotNull(supplyNameMap[SupplyPickUpSpot.xCannon]) ) to Colors.MINECRAFT_GRAY, Lineup( supply = SupplyPickUpSpot.Square, @@ -92,7 +92,7 @@ object PearlWaypoints : Module( BlockPos(-97, 97, -98), // Equals BlockPos(-105, 155, -98) // Slash ), - endPos = setOf(supplyNameMap[NoPre.missing] as BlockPos) + endPos = setOfNotNull(supplyNameMap[NoPre.missing]) ) to Colors.MINECRAFT_AQUA, Lineup( supply = SupplyPickUpSpot.SquareLow, @@ -105,19 +105,19 @@ object PearlWaypoints : Module( BlockPos(-97, 102, -98), // Equals BlockPos(-105, 149, -98) // Slash ), - endPos = setOf(supplyNameMap[NoPre.missing] as BlockPos) + endPos = setOfNotNull(supplyNameMap[NoPre.missing]) ) to Colors.MINECRAFT_DARK_AQUA, Lineup( supply = SupplyPickUpSpot.Equals, startPos = setOf(BlockPos(-66, 76, -87)), lineups = setOf(BlockPos(-97, 153, -98)), - endPos = setOf(supplyNameMap[SupplyPickUpSpot.Equals] as BlockPos) + endPos = setOfNotNull(supplyNameMap[SupplyPickUpSpot.Equals]) ) to Colors.MINECRAFT_GREEN, Lineup( supply = SupplyPickUpSpot.Slash, startPos = setOf(BlockPos(-113, 77, -69)), lineups = setOf(BlockPos(-105, 157, -99)), - endPos = setOf(supplyNameMap[SupplyPickUpSpot.Slash] as BlockPos) + endPos = setOfNotNull(supplyNameMap[SupplyPickUpSpot.Slash]) ) to Colors.MINECRAFT_BLUE )