Entity: cancel fire damage for fireproof entities

This commit is contained in:
Dylan K. Taylor 2022-07-14 19:52:51 +01:00
parent 705df7d508
commit baf75089f5
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -522,6 +522,9 @@ abstract class Entity{
}
public function attack(EntityDamageEvent $source) : void{
if($this->isFireProof() && ($source->getCause() === EntityDamageEvent::CAUSE_FIRE || $source->getCause() === EntityDamageEvent::CAUSE_FIRE_TICK)){
$source->cancel();
}
$source->call();
if($source->isCancelled()){
return;