aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/rift
diff options
context:
space:
mode:
authorEmpa <42304516+ItsEmpa@users.noreply.github.com>2024-10-11 19:01:42 +0200
committerGitHub <noreply@github.com>2024-10-11 19:01:42 +0200
commit9a2286ac3070e1ba0023445dc8243e618989e86e (patch)
tree6c4ad95a8df2ce6fff17e5ea96f8df09c4e5ea07 /src/main/java/at/hannibal2/skyhanni/features/rift
parent8c54be95700b224c2f93b549465dbe06bf3bbe86 (diff)
downloadskyhanni-9a2286ac3070e1ba0023445dc8243e618989e86e.tar.gz
skyhanni-9a2286ac3070e1ba0023445dc8243e618989e86e.tar.bz2
skyhanni-9a2286ac3070e1ba0023445dc8243e618989e86e.zip
Backend: LorenzVec up/down and drawLineToEye (#2056)
Co-authored-by: ItsEmpa <itsempa@users.noreply.github.com> Co-authored-by: Cal <cwolfson58@gmail.com> Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/rift')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftAgaricusCap.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftWiltedBerberisHelper.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/VoltHighlighter.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt15
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftUpsideDownParkour.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/RiftMotesOrb.kt2
7 files changed, 15 insertions, 16 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftAgaricusCap.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftAgaricusCap.kt
index 161200fed..d601601a1 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftAgaricusCap.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftAgaricusCap.kt
@@ -63,7 +63,7 @@ object RiftAgaricusCap {
fun onRenderWorld(event: LorenzRenderWorldEvent) {
if (!isEnabled()) return
- val location = location?.add(y = 0.6) ?: return
+ val location = location?.up(0.6) ?: return
if (startTime.isFarFuture()) {
event.drawDynamicText(location, "§cClick!", 1.5)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftWiltedBerberisHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftWiltedBerberisHelper.kt
index 9ff96213b..4ac014d3a 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftWiltedBerberisHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftWiltedBerberisHelper.kt
@@ -52,7 +52,7 @@ object RiftWiltedBerberisHelper {
hasFarmingToolInHand = InventoryUtils.getItemInHand()?.getInternalName() == RiftAPI.farmingTool
if (Minecraft.getMinecraft().thePlayer.onGround) {
- val block = LocationUtils.playerLocation().add(y = -1).getBlockAt()
+ val block = LorenzVec.getBlockBelowPlayer().getBlockAt()
val currentY = LocationUtils.playerLocation().y
isOnFarmland = block == Blocks.farmland && (currentY % 1 == 0.0)
}
@@ -132,7 +132,7 @@ object RiftWiltedBerberisHelper {
val location = currentParticles.fixLocation(berberis)
if (!moving) {
event.drawFilledBoundingBox_nea(axisAlignedBB(location), Color.YELLOW, 0.7f)
- event.drawDynamicText(location.add(y = 1), "§eWilted Berberis", 1.5, ignoreBlocks = false)
+ event.drawDynamicText(location.up(), "§eWilted Berberis", 1.5, ignoreBlocks = false)
} else {
event.drawFilledBoundingBox_nea(axisAlignedBB(location), Color.WHITE, 0.5f)
previous?.fixLocation(berberis)?.let {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/VoltHighlighter.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/VoltHighlighter.kt
index 6b94919ee..50c6593fb 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/VoltHighlighter.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/VoltHighlighter.kt
@@ -78,9 +78,9 @@ object VoltHighlighter {
val dischargeTimeLeft = CHARGE_TIME - dischargingSince.passedSince()
if (dischargeTimeLeft > Duration.ZERO) {
event.drawDynamicText(
- event.exactLocation(entity).add(y = 2.5),
+ event.exactLocation(entity).up(2.5),
"§eLightning: ${dischargeTimeLeft.format(showMilliSeconds = true)}",
- 2.5
+ 2.5,
)
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt
index 275ca3573..dd5910b58 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt
@@ -17,8 +17,9 @@ import at.hannibal2.skyhanni.utils.LocationUtils.distanceTo
import at.hannibal2.skyhanni.utils.LorenzVec
import at.hannibal2.skyhanni.utils.RenderUtils.draw3DLine
import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText
+import at.hannibal2.skyhanni.utils.RenderUtils.drawLineToEye
import at.hannibal2.skyhanni.utils.RenderUtils.drawWaypointFilled
-import at.hannibal2.skyhanni.utils.getLorenzVec
+import at.hannibal2.skyhanni.utils.RenderUtils.exactLocation
import net.minecraft.client.entity.EntityOtherPlayerMP
import net.minecraft.util.EnumParticleTypes
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -140,18 +141,16 @@ object LivingCaveDefenseBlocks {
fun onRenderWorld(event: LorenzRenderWorldEvent) {
if (!isEnabled()) return
-
for ((block, time) in movingBlocks) {
if (block.hidden) continue
if (time > System.currentTimeMillis()) {
val location = block.location
event.drawWaypointFilled(location, color)
- event.draw3DLine(
- block.entity.getLorenzVec().add(y = 0.5),
- location.add(0.5, 0.5, 0.5),
+ event.drawLineToEye(
+ location.blockCenter(),
color,
1,
- false
+ false,
)
}
}
@@ -161,8 +160,8 @@ object LivingCaveDefenseBlocks {
event.drawWaypointFilled(location, color)
event.draw3DLine(
- block.entity.getLorenzVec().add(y = 0.5),
- location.add(0.5, 0.5, 0.5),
+ event.exactLocation(block.entity).up(0.5),
+ location.blockCenter(),
color,
3,
true,
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftUpsideDownParkour.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftUpsideDownParkour.kt
index c93932344..2ff0eac99 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftUpsideDownParkour.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftUpsideDownParkour.kt
@@ -27,7 +27,7 @@ object RiftUpsideDownParkour {
data.locations.map { it.add(-1.0, -1.0, -1.0) }, // TODO remove offset. change repo instead
data.shortCuts,
platformSize = 2.0,
- detectionRange = 2.0
+ detectionRange = 2.0,
)
updateConfig()
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt
index 86ae6d096..24b254736 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt
@@ -163,7 +163,7 @@ object EnigmaSoulWaypoints {
for (soul in trackedSouls) {
soulLocations[soul]?.let {
event.drawWaypointFilled(it, config.color.toChromaColor(), seeThroughBlocks = true, beacon = true)
- event.drawDynamicText(it.add(y = 1), "§5${soul.removeSuffix(" Soul")} Soul", 1.5)
+ event.drawDynamicText(it.up(), "§5${soul.removeSuffix(" Soul")} Soul", 1.5)
}
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/RiftMotesOrb.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/RiftMotesOrb.kt
index 4fc0ccbf5..064dbf506 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/RiftMotesOrb.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/RiftMotesOrb.kt
@@ -87,7 +87,7 @@ object RiftMotesOrb {
orb.pickedUp = true
}
- val location = orb.location.add(y = 0.5)
+ val location = orb.location.up(0.5)
val sizeOffset = (5 - config.size) * -0.1
val color = if (orb.pickedUp) LorenzColor.GRAY else LorenzColor.LIGHT_PURPLE
val text = color.getChatColor() + "Motes Orb"