Add Entity.isStandingInMidAir
This commit is contained in:
@@ -50,6 +50,12 @@ val Entity.groundMaterial get() = this.location.add(0.0, -0.01, 0.0).block.type
|
|||||||
val Entity.isStandingOnBlock: Boolean
|
val Entity.isStandingOnBlock: Boolean
|
||||||
get() = groundMaterial.isSolid
|
get() = groundMaterial.isSolid
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @returns true if the entity is standing in mid air.
|
||||||
|
*/
|
||||||
|
val Entity.isStandingInMidAir: Boolean
|
||||||
|
get() = !isStandingOnBlock && vehicle == null && !location.clone().add(0.0, 0.1, 0.0).block.type.isSolid && !location.block.type.isSolid
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The max health of the entity
|
* @return The max health of the entity
|
||||||
* @throws NullPointerException if the entity doesn't have a max health value
|
* @throws NullPointerException if the entity doesn't have a max health value
|
||||||
|
Reference in New Issue
Block a user