aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-07-29 16:53:07 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-07-29 16:53:07 +0200
commite10493b7318931938f03ec56f106cf5e27225fa5 (patch)
tree75258619158f217924933778e89759f97938f13d /src/main/java
parente2813fd6cbe043ad61aeb31e532413dd0aaab1bd (diff)
parent2a3652012a46bcad4ad0cc896a5a8f290e6f62c3 (diff)
downloadskyhanni-e10493b7318931938f03ec56f106cf5e27225fa5.tar.gz
skyhanni-e10493b7318931938f03ec56f106cf5e27225fa5.tar.bz2
skyhanni-e10493b7318931938f03ec56f106cf5e27225fa5.zip
Merge remote-tracking branch 'origin/beta' into beta
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/test/ParkourWaypointSaver.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt9
3 files changed, 12 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/ParkourWaypointSaver.kt b/src/main/java/at/hannibal2/skyhanni/test/ParkourWaypointSaver.kt
index 2fb009914..e2fc562f3 100644
--- a/src/main/java/at/hannibal2/skyhanni/test/ParkourWaypointSaver.kt
+++ b/src/main/java/at/hannibal2/skyhanni/test/ParkourWaypointSaver.kt
@@ -36,7 +36,7 @@ class ParkourWaypointSaver {
update()
}
if (config.saveKey == key) {
- val newLocation = LocationUtils.playerLocation().roundLocation()
+ val newLocation = LorenzVec.getBlockBelowPlayer()
if (locations.isNotEmpty()) {
if (newLocation == locations.last()) return
}
@@ -69,7 +69,7 @@ class ParkourWaypointSaver {
fun onRenderWorld(event: RenderWorldLastEvent) {
if (!LorenzUtils.inSkyBlock) return
- if (locations.size > 2) {
+ if (locations.size > 1) {
parkourHelper?.render(event)
} else {
for (location in locations) {
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt
index 54ea399bb..dd4a264ac 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt
@@ -42,7 +42,7 @@ object InventoryUtils {
fun getArmor(): Array<ItemStack?> = Minecraft.getMinecraft().thePlayer.inventory.armorInventory
fun inStorage() =
- openInventoryName().let { (it.contains("Storage") && it != "Rift Storage") || it.contains("Ender Chest") || it.contains("Backpack")}
+ openInventoryName().let { (it.contains("Storage") && !it.contains("Rift Storage")) || it.contains("Ender Chest") || it.contains("Backpack")}
fun getItemInHand(): ItemStack? = Minecraft.getMinecraft().thePlayer.heldItem
} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt
index 46f273b2d..5f719da63 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt
@@ -96,6 +96,13 @@ data class LorenzVec(
fun round(decimals: Int) = LorenzVec(x.round(decimals), y.round(decimals), z.round(decimals))
+ fun roundLocationToBlock(): LorenzVec {
+ val x = (x - .499999).round(0)
+ val y = (y - .499999).round(0)
+ val z = (z - .499999).round(0)
+ return LorenzVec(x, y, z)
+ }
+
fun slope(other: LorenzVec, factor: Double) = add(other.subtract(this).scale(factor))
fun roundLocation(): LorenzVec {
@@ -127,6 +134,8 @@ data class LorenzVec(
val (x, y, z) = string.split(":").map { it.toDouble() }
return LorenzVec(x, y, z)
}
+
+ fun getBlockBelowPlayer() = LocationUtils.playerLocation().roundLocationToBlock().add(0.0, -1.0, 0.0)
}
}