From 326ded0189204ee9b57405889bae098b3cf6051d Mon Sep 17 00:00:00 2001 From: Lorenz Date: Sun, 11 Sep 2022 21:48:24 +0200 Subject: Fixed enderman beacon position and showing beacons nearby ignoring walls --- .../hannibal2/skyhanni/features/slayer/EndermanSlayerBeacon.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/main/java') 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) } } -- cgit