Added isOnMaterial(material: Material) extension

This commit is contained in:
copyandexecute
2021-08-27 19:34:47 +02:00
parent 87e1b836da
commit d8d2d7ae88

View File

@@ -29,6 +29,12 @@ val Entity.isFeetInWater: Boolean get() = this.location.block.type == Material.W
*/
val Entity.isGroundSolid: Boolean get() = this.location.add(0.0, -0.01, 0.0).block.type.isSolid
/**
* Checks if the entity stands on a specific material.
* @param material the material you are looking for
*/
fun Entity.isOnMaterial(material: Material): Boolean = location.block.type == material
/**
* Kills the damageable.
*/