Improved effects, threading changes

This commit is contained in:
Shoghi Cervantes
2015-04-08 17:31:06 +02:00
parent 76767294bf
commit 71657a2a4e
8 changed files with 73 additions and 19 deletions

View File

@ -73,6 +73,15 @@ abstract class Living extends Entity implements Damageable{
//return $this->getLevel()->rayTraceBlocks(Vector3::createVector($this->x, $this->y + $this->height, $this->z), Vector3::createVector($entity->x, $entity->y + $entity->height, $entity->z)) === null;
}
public function heal($amount, EntityRegainHealthEvent $source){
parent::heal($amount, $source);
if($source->isCancelled()){
return;
}
$this->attackTime = 0;
}
public function attack($damage, EntityDamageEvent $source){
if($this->attackTime > 0 or $this->noDamageTicks > 0){
$lastCause = $this->getLastDamageCause();