Added Effects base, /effect and methods

This commit is contained in:
Shoghi Cervantes
2015-03-15 23:11:12 +01:00
parent f9361aa931
commit 4383e272eb
13 changed files with 478 additions and 16 deletions

View File

@ -70,6 +70,10 @@ abstract class Living extends Entity implements Damageable{
}
public function attack($damage, $source = EntityDamageEvent::CAUSE_MAGIC){
if($this->hasEffect(Effect::FIRE_RESISTANCE) and $source){
return;
}
if($this->attackTime > 0 or $this->noDamageTicks > 0){
$lastCause = $this->getLastDamageCause();
if($lastCause instanceof EntityDamageEvent and $lastCause->getDamage() >= $damage){