From 617130c7f52d35335cd6f4f7f14e7fd3dc3af3af Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 24 May 2023 23:20:53 +0200 Subject: Reworked Hide Armor --- src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt | 8 ++++++++ 1 file changed, 8 insertions(+) (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 c27d464d7..9e095ec1e 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt @@ -8,6 +8,8 @@ import net.minecraft.entity.EntityLivingBase import net.minecraft.entity.item.EntityArmorStand import net.minecraft.entity.monster.EntityBlaze import net.minecraft.entity.player.EntityPlayer +import net.minecraft.item.ItemStack +import net.minecraft.potion.Potion import net.minecraft.util.AxisAlignedBB object EntityUtils { @@ -118,4 +120,10 @@ object EntityUtils { if (inventory == null) return false return inventory.any { it != null && it.getSkullTexture() == skin } } + + fun EntityPlayer.isNPC() = uniqueID == null || uniqueID.version() != 4 + + fun EntityLivingBase.hasPotionEffect(potion: Potion) = getActivePotionEffect(potion) != null + + fun EntityLivingBase.getArmorInventory(): Array? = if (this is EntityPlayer) inventory.armorInventory else null } \ No newline at end of file -- cgit