Skip to content

Commit

Permalink
Fix mining waypoints moving on warp
Browse files Browse the repository at this point in the history
  • Loading branch information
My-Name-Is-Jeff committed Sep 2, 2023
1 parent 2539426 commit 97d9f6c
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ object MiningFeatures {
private var inRaffle = false
var lastTPLoc: BlockPos? = null
var waypoints = hashMapOf<String, BlockPos>()
var deadCount = 0
var waypointDelayTicks = 0
private val SBE_DSM_PATTERN =
Regex("\\\$(?:SBECHWP\\b|DSMCHWP):(?<stringLocation>.*?)@-(?<x>-?\\d+),(?<y>-?\\d+),(?<z>-?\\d+)")
private val xyzPattern =
Expand Down Expand Up @@ -240,8 +240,8 @@ object MiningFeatures {
) {
CrystalHollowsMap.Locations.KingYolkar.loc.set()
}
if (formatted.startsWith("§r§cYou died")) {
deadCount =
if (formatted.startsWith("§r§f§r§c ☠")) {
waypointDelayTicks =
50 //this is to make sure the scoreboard has time to update and nothing moves halfway across the map
if (Skytils.config.crystalHollowDeathWaypoint && SBInfo.mode == SkyblockIsland.CrystalHollows.mode && lastTPLoc != null) {
UChat.chat(
Expand All @@ -251,6 +251,8 @@ object MiningFeatures {
)
)
}
} else if (unformatted.startsWith("Warp")) {
waypointDelayTicks = 50
}
}

Expand Down Expand Up @@ -387,11 +389,11 @@ object MiningFeatures {
fun onTick(event: ClientTickEvent) {
if (!Utils.inSkyblock || event.phase != TickEvent.Phase.START) return
if ((Skytils.config.crystalHollowWaypoints || Skytils.config.crystalHollowMapPlaces) && SBInfo.mode == SkyblockIsland.CrystalHollows.mode
&& deadCount == 0 && mc.thePlayer != null
&& waypointDelayTicks == 0 && mc.thePlayer != null
) {
CrystalHollowsMap.Locations.cleanNameToLocation[SBInfo.location]?.loc?.set()
} else if (deadCount > 0)
deadCount--
} else if (waypointDelayTicks > 0)
waypointDelayTicks--
}

@SubscribeEvent
Expand Down

0 comments on commit 97d9f6c

Please sign in to comment.