From 635d6cee39cf710286364c47d3419bd6e923a513 Mon Sep 17 00:00:00 2001 From: HiZe_ Date: Tue, 11 Jul 2023 10:38:22 +0200 Subject: Merge pull request #302 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feature * save * changed things, fixed things * fixes * Merge branch 'beta' of https://github.com/hannibal002/skyhanni into h… * typo * changed how seeThrough work * moved function to entityutils * updated desc in config * changed value * Blood Ichor highlight * added killer spring highlight * warning for twinclaws * forgot to add config for twinclaws * renamed class * changed twinclaws title to be bold, moved it up a bit and extended ti… * always highlight co-op boss * save * config option for blood ichor beam * checking distance before processing * update * fixes * small fixes * changed detection from 20 to 15 blocs * merged beta * fixed crash with conflicting class name * moved everything in its own config, add steak title for each section * wording * Merge branch 'beta' into highlight_own_vampire * Moving vampire config into slayer category * Fixed one thing * IntelliJ auto formattings * IntelliJ auto formattings * Unnecessary check * code cleanup * parameter is already default false * moved distance check * merged beta * Fixed shouldRender --- .../at/hannibal2/skyhanni/utils/EntityUtils.kt | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/utils') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt index 9e095ec1e..6af83a805 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt @@ -3,7 +3,6 @@ package at.hannibal2.skyhanni.utils import at.hannibal2.skyhanni.utils.ItemUtils.getSkullTexture import at.hannibal2.skyhanni.utils.LorenzUtils.baseMaxHealth import net.minecraft.client.multiplayer.WorldClient -import net.minecraft.entity.EntityLiving import net.minecraft.entity.EntityLivingBase import net.minecraft.entity.item.EntityArmorStand import net.minecraft.entity.monster.EntityBlaze @@ -14,7 +13,7 @@ import net.minecraft.util.AxisAlignedBB object EntityUtils { - fun EntityLiving.hasNameTagWith( + fun EntityLivingBase.hasNameTagWith( y: Int, contains: String, debugRightEntity: Boolean = false, @@ -24,7 +23,7 @@ object EntityUtils { return getNameTagWith(y, contains, debugRightEntity, inaccuracy, debugWrongEntity) != null } - fun EntityLiving.getAllNameTagsWith( + fun EntityLivingBase.getAllNameTagsWith( y: Int, contains: String, debugRightEntity: Boolean = false, @@ -51,7 +50,23 @@ object EntityUtils { } } - fun EntityLiving.getNameTagWith( + fun EntityLivingBase.getAllNameTagsInRadiusWith( + contains: String, + radius: Double = 3.0, + ): List { + val center = getLorenzVec().add(0, 3, 0) + val a = center.add(-radius, -radius - 3, -radius).toBlocPos() + val b = center.add(radius, radius + 3, radius).toBlocPos() + val alignedBB = AxisAlignedBB(a, b) + val clazz = EntityArmorStand::class.java + val found = worldObj.getEntitiesWithinAABB(clazz, alignedBB) + return found.filter { + val result = it.name.contains(contains) + result + } + } + + fun EntityLivingBase.getNameTagWith( y: Int, contains: String, debugRightEntity: Boolean = false, -- cgit