mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 19:24:12 +00:00
Implement anvil fall damage (#5312)
This commit is contained in:
@ -42,6 +42,18 @@ interface Fallable{
|
||||
*/
|
||||
public function onHitGround(FallingBlock $blockEntity) : bool;
|
||||
|
||||
/**
|
||||
* Returns the damage caused per fallen block. This is multiplied by the fall distance (and capped according to
|
||||
* {@link Fallable::getMaxFallDamage()}) to calculate the damage dealt to any entities who intersect with the block
|
||||
* when it hits the ground.
|
||||
*/
|
||||
public function getFallDamagePerBlock() : float;
|
||||
|
||||
/**
|
||||
* Returns the maximum damage the block can deal to an entity when it hits the ground.
|
||||
*/
|
||||
public function getMaxFallDamage() : float;
|
||||
|
||||
/**
|
||||
* Returns the sound that will be played when FallingBlock hits the ground.
|
||||
*/
|
||||
|
@ -64,6 +64,14 @@ trait FallableTrait{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getFallDamagePerBlock() : float{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
public function getMaxFallDamage() : float{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
public function getLandSound() : ?Sound{
|
||||
return null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user