mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-09 13:14:54 +00:00
Entity: cancel fire damage for fireproof entities
This commit is contained in:
parent
705df7d508
commit
baf75089f5
@ -522,6 +522,9 @@ abstract class Entity{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function attack(EntityDamageEvent $source) : void{
|
public function attack(EntityDamageEvent $source) : void{
|
||||||
|
if($this->isFireProof() && ($source->getCause() === EntityDamageEvent::CAUSE_FIRE || $source->getCause() === EntityDamageEvent::CAUSE_FIRE_TICK)){
|
||||||
|
$source->cancel();
|
||||||
|
}
|
||||||
$source->call();
|
$source->call();
|
||||||
if($source->isCancelled()){
|
if($source->isCancelled()){
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user