mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 20:14:31 +00:00
Added more damage sources
This commit is contained in:
@@ -581,8 +581,15 @@ abstract class Entity extends Position implements Metadatable{
|
||||
return $this->boundingBox;
|
||||
}
|
||||
|
||||
public function fall($fallDistance){ //TODO
|
||||
|
||||
public function fall($fallDistance){
|
||||
$damage = floor($fallDistance - 3);
|
||||
if($damage > 0){
|
||||
$this->server->getPluginManager()->callEvent($ev = new EntityDamageEvent($this, EntityDamageEvent::CAUSE_FALL, $damage));
|
||||
if($ev->isCancelled()){
|
||||
return;
|
||||
}
|
||||
$this->attack($ev->getFinalDamage(), $ev);
|
||||
}
|
||||
}
|
||||
|
||||
public function handleWaterMovement(){ //TODO
|
||||
|
Reference in New Issue
Block a user