This commit is contained in:
PEMapModder 2016-03-07 18:48:27 +08:00
parent 08e6caad88
commit df7eaa7242

View File

@ -602,10 +602,11 @@ abstract class Entity extends Location implements Metadatable{
* *
*/ */
public function attack($damage, EntityDamageEvent $source){ public function attack($damage, EntityDamageEvent $source){
if($this->hasEffect(Effect::FIRE_RESISTANCE) if($this->hasEffect(Effect::FIRE_RESISTANCE) and (
and $source->getCause() === EntityDamageEvent::CAUSE_FIRE $source->getCause() === EntityDamageEvent::CAUSE_FIRE
and $source->getCause() === EntityDamageEvent::CAUSE_FIRE_TICK or $source->getCause() === EntityDamageEvent::CAUSE_FIRE_TICK
and $source->getCause() === EntityDamageEvent::CAUSE_LAVA or $source->getCause() === EntityDamageEvent::CAUSE_LAVA
)
){ ){
$source->setCancelled(); $source->setCancelled();
} }