Skip to content

Commit 97d9f6c

Browse files
Fix mining waypoints moving on warp
#411
1 parent 2539426 commit 97d9f6c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/main/kotlin/gg/skytils/skytilsmod/features/impl/mining/MiningFeatures.kt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ object MiningFeatures {
7676
private var inRaffle = false
7777
var lastTPLoc: BlockPos? = null
7878
var waypoints = hashMapOf<String, BlockPos>()
79-
var deadCount = 0
79+
var waypointDelayTicks = 0
8080
private val SBE_DSM_PATTERN =
8181
Regex("\\\$(?:SBECHWP\\b|DSMCHWP):(?<stringLocation>.*?)@-(?<x>-?\\d+),(?<y>-?\\d+),(?<z>-?\\d+)")
8282
private val xyzPattern =
@@ -240,8 +240,8 @@ object MiningFeatures {
240240
) {
241241
CrystalHollowsMap.Locations.KingYolkar.loc.set()
242242
}
243-
if (formatted.startsWith("§r§cYou died")) {
244-
deadCount =
243+
if (formatted.startsWith("§r§f§r§c ☠")) {
244+
waypointDelayTicks =
245245
50 //this is to make sure the scoreboard has time to update and nothing moves halfway across the map
246246
if (Skytils.config.crystalHollowDeathWaypoint && SBInfo.mode == SkyblockIsland.CrystalHollows.mode && lastTPLoc != null) {
247247
UChat.chat(
@@ -251,6 +251,8 @@ object MiningFeatures {
251251
)
252252
)
253253
}
254+
} else if (unformatted.startsWith("Warp")) {
255+
waypointDelayTicks = 50
254256
}
255257
}
256258

@@ -387,11 +389,11 @@ object MiningFeatures {
387389
fun onTick(event: ClientTickEvent) {
388390
if (!Utils.inSkyblock || event.phase != TickEvent.Phase.START) return
389391
if ((Skytils.config.crystalHollowWaypoints || Skytils.config.crystalHollowMapPlaces) && SBInfo.mode == SkyblockIsland.CrystalHollows.mode
390-
&& deadCount == 0 && mc.thePlayer != null
392+
&& waypointDelayTicks == 0 && mc.thePlayer != null
391393
) {
392394
CrystalHollowsMap.Locations.cleanNameToLocation[SBInfo.location]?.loc?.set()
393-
} else if (deadCount > 0)
394-
deadCount--
395+
} else if (waypointDelayTicks > 0)
396+
waypointDelayTicks--
395397
}
396398

397399
@SubscribeEvent

0 commit comments

Comments
 (0)