Skip to content

Commit

Permalink
Improvement: Add pathfinding to Halloween baskets 2024 (#2660)
Browse files Browse the repository at this point in the history
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
  • Loading branch information
martimavocado and hannibal002 authored Nov 1, 2024
1 parent 2f2d5ff commit 81df969
Show file tree
Hide file tree
Showing 8 changed files with 179 additions and 120 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,25 @@
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption;
import io.github.notenoughupdates.moulconfig.observer.Property;

public class HalloweenBasketConfig {

@Expose
@ConfigOption(name = "Basket Waypoints", desc = "Show all Halloween Basket waypoints.\n" +
"Coordinates by §bTobbbb§7. (last updated: 2023)")
@ConfigOption(name = "Enabled", desc = "Show all Halloween Basket waypoints.\n" +
"§eCoordinates may not always be up to date!")
@ConfigEditorBoolean
@FeatureToggle
// TODO rename to "enabled"
public boolean allWaypoints = false;

@Expose
@ConfigOption(name = "Entrance Waypoints", desc = "Show helper waypoints to Baskets #23, #24, and #25.\n" +
"Coordinates by §bErymanthus§7.")
@ConfigOption(name = "Only Closest", desc = "Only show the closest waypoint.")
@ConfigEditorBoolean
public boolean allEntranceWaypoints = false;
public boolean onlyClosest = true;

@Expose
@ConfigOption(name = "Only Closest", desc = "Only show the closest waypoint.")
@ConfigOption(name = "Pathfind", desc = "Show a path to the closest basket.")
@ConfigEditorBoolean
public boolean onlyClosest = true;
public Property<Boolean> pathfind = Property.of(true);
}
10 changes: 7 additions & 3 deletions src/main/java/at/hannibal2/skyhanni/data/IslandGraphs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ object IslandGraphs {
}
}

fun loadLobby(lobby: String) {
reloadFromJson(lobby)
}

private fun loadDwarvenMines() {
if (isGlaciteTunnelsArea(LorenzUtils.skyBlockArea)) {
reloadFromJson("GLACITE_TUNNELS")
Expand Down Expand Up @@ -226,7 +230,7 @@ object IslandGraphs {

@SubscribeEvent
fun onTick(event: LorenzTickEvent) {
if (!LorenzUtils.inSkyBlock) return
if (currentIslandGraph == null) return
if (event.isMod(2)) {
handleTick()
checkMoved()
Expand Down Expand Up @@ -329,7 +333,7 @@ object IslandGraphs {

@SubscribeEvent
fun onPlayerMove(event: EntityMoveEvent) {
if (LorenzUtils.inSkyBlock && event.entity == Minecraft.getMinecraft().thePlayer) {
if (currentIslandGraph != null && event.entity == Minecraft.getMinecraft().thePlayer) {
hasMoved = true
}
}
Expand Down Expand Up @@ -475,7 +479,7 @@ object IslandGraphs {

@SubscribeEvent
fun onRenderWorld(event: LorenzRenderWorldEvent) {
if (!LorenzUtils.inSkyBlock) return
if (currentIslandGraph == null) return
val path = fastestPath ?: return

// maybe reuse for debuggin
Expand Down
21 changes: 15 additions & 6 deletions src/main/java/at/hannibal2/skyhanni/data/model/GraphNodeTag.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ enum class GraphNodeTag(
val cleanName: String,
val description: String,
val onlyIsland: IslandType? = null,
val onlySkyblock: Boolean? = true
) {
DEV("dev", LorenzColor.WHITE, "Dev", "Intentionally marked as dev."), // E.g. Spawn points, todos, etc
DEV("dev", LorenzColor.WHITE, "Dev", "Intentionally marked as dev.", onlySkyblock = null), // E.g. Spawn points, todos, etc

// Everywhere
NPC("npc", LorenzColor.YELLOW, "NPC", "A NPC to talk to."), // also take from neu repo
AREA("area", LorenzColor.DARK_GREEN, "Area", "A big SkyBlock area."),
SMALL_AREA("small_area", LorenzColor.GREEN, "Small Area", "A small SkyBlock area, e.g. a house."),
POI("poi", LorenzColor.WHITE, "Point of Interest", "A relevant spot or a landmark on the map."),
NPC("npc", LorenzColor.YELLOW, "NPC", "A NPC to talk to.", onlySkyblock = null), // also take from neu repo
AREA("area", LorenzColor.DARK_GREEN, "Area", "A big SkyBlock area.", onlySkyblock = null),
SMALL_AREA("small_area", LorenzColor.GREEN, "Small Area", "A small SkyBlock area, e.g. a house.", onlySkyblock = null),
POI("poi", LorenzColor.WHITE, "Point of Interest", "A relevant spot or a landmark on the map.", onlySkyblock = null),

// LAUNCH_PAD("launch", LorenzColor.WHITE, "Launch Pad", "Slime blocks sending you to another server."),
TELEPORT("teleport", LorenzColor.BLUE, "Teleport", "A spot from/to teleport."),
TELEPORT("teleport", LorenzColor.BLUE, "Teleport", "A spot from/to teleport.", onlySkyblock = null),

// on multiple islands
ROMEO("romeo", LorenzColor.WHITE, "Romeo & Juliette Quest", "Spots related to the Romeo and Juliette/Ring of Love quest line."),
Expand Down Expand Up @@ -85,6 +86,14 @@ enum class GraphNodeTag(
// The End
END_GOLEM("end_golem", LorenzColor.RED, "Golem Spawn", "A spot where the golem can spawn in the End.", onlyIsland = IslandType.THE_END),

// lobby event waypoints
HALLOWEEN_BASKET(
"event_basket",
LorenzColor.LIGHT_PURPLE,
"Basket",
"A Basket during the Halloween Event.",
onlySkyblock = false,
),
;

val displayName: String = color.getChatColor() + cleanName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.data.jsonobjects.repo.EventWaypointData
import at.hannibal2.skyhanni.utils.LorenzVec

data class EventWaypoint(
val name: String,
val name: String = "",
val position: LorenzVec,
var isFound: Boolean = false,
)
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 81df969

Please sign in to comment.