aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorLorenz <lo.scherf@gmail.com>2022-09-11 21:48:24 +0200
committerLorenz <lo.scherf@gmail.com>2022-09-11 21:48:24 +0200
commit326ded0189204ee9b57405889bae098b3cf6051d (patch)
tree5f4d016272bd43054f93dcce0b4feb1e42fd96bf /src/main
parent7087d65d9e2075a4977ca02e1751638364399773 (diff)
downloadskyhanni-326ded0189204ee9b57405889bae098b3cf6051d.tar.gz
skyhanni-326ded0189204ee9b57405889bae098b3cf6051d.tar.bz2
skyhanni-326ded0189204ee9b57405889bae098b3cf6051d.zip
Fixed enderman beacon position and showing beacons nearby ignoring walls
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerBeacon.kt10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerBeacon.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerBeacon.kt
index 15b497936..1364dc56c 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerBeacon.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/EndermanSlayerBeacon.kt
@@ -54,7 +54,7 @@ class EndermanSlayerBeacon {
if (entity is EntityEnderman) {
if (hasBeaconInHand(entity)) {
- if (LocationUtils.canSee(LocationUtils.playerEyeLocation(), entity.getLorenzVec())) {
+ if (canSee(LocationUtils.playerEyeLocation(), entity.getLorenzVec())) {
endermans.add(entity)
}
}
@@ -63,13 +63,17 @@ class EndermanSlayerBeacon {
if (entity is EntityArmorStand) {
val stack = entity.inventory[4] ?: return
if (stack.name == "Beacon") {
- if (LocationUtils.canSee(LocationUtils.playerEyeLocation(), entity.getLorenzVec())) {
+ if (canSee(LocationUtils.playerEyeLocation(), entity.getLorenzVec())) {
armorStands.add(entity)
}
}
}
}
+ private fun canSee(a: LorenzVec, b: LorenzVec): Boolean {
+ return LocationUtils.canSee(a, b) || a.distance(b) < 15
+ }
+
@SubscribeEvent
fun onRenderMobColored(event: RenderMobColoredEvent) {
if (!isEnabled()) return
@@ -92,7 +96,7 @@ class EndermanSlayerBeacon {
for (location in blocks) {
event.drawColor(location, LorenzColor.DARK_RED, alpha = 1f)
- event.drawString(location.add(0.5, -0.5, 0.5), "Beacon", true)
+ event.drawString(location.add(0.5, 0.5, 0.5), "ยง4Beacon", true)
}
}