aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/test/ParkourWaypointSaver.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test/ParkourWaypointSaver.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/ParkourWaypointSaver.kt21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/ParkourWaypointSaver.kt b/src/main/java/at/hannibal2/skyhanni/test/ParkourWaypointSaver.kt
index e74a6acff..65e2e6275 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/ParkourWaypointSaver.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/ParkourWaypointSaver.kt
@@ -29,15 +29,18 @@ class ParkourWaypointSaver {
if (NEUItems.neuHasFocus()) return
if (timeLastSaved.passedSince() < 250.milliseconds) return
- if (config.deleteKey == event.keyCode) {
- locations = locations.dropLast(1).toMutableList()
- update()
- }
- if (config.saveKey == event.keyCode) {
- val newLocation = LorenzVec.getBlockBelowPlayer()
- if (locations.isNotEmpty() && newLocation == locations.last()) return
- locations.add(newLocation)
- update()
+ when (event.keyCode) {
+ config.deleteKey -> {
+ locations = locations.dropLast(1).toMutableList()
+ update()
+ }
+
+ config.saveKey -> {
+ val newLocation = LorenzVec.getBlockBelowPlayer()
+ if (locations.isNotEmpty() && newLocation == locations.last()) return
+ locations.add(newLocation)
+ update()
+ }
}
}