diff options
| author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-05-24 23:20:53 +0200 |
|---|---|---|
| committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-05-24 23:20:53 +0200 |
| commit | 617130c7f52d35335cd6f4f7f14e7fd3dc3af3af (patch) | |
| tree | ff16fe3469759c85be289c3e88fa48b65e98f1f2 /src/main/java/at/hannibal2/skyhanni/utils | |
| parent | 1ab8930cee2d6740b9b9dbf0a496c5e6e0f195fe (diff) | |
| download | SkyHanni-617130c7f52d35335cd6f4f7f14e7fd3dc3af3af.tar.gz SkyHanni-617130c7f52d35335cd6f4f7f14e7fd3dc3af3af.tar.bz2 SkyHanni-617130c7f52d35335cd6f4f7f14e7fd3dc3af3af.zip | |
Reworked Hide Armor
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/EntityUtils.kt | 8 |
1 files changed, 8 insertions, 0 deletions
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<ItemStack?>? = if (this is EntityPlayer) inventory.armorInventory else null }
\ No newline at end of file |
