mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +00:00
Merge branch 'next-minor' into next-major
This commit is contained in:
commit
d4f4fda442
@ -493,6 +493,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;
|
||||||
|
@ -82,14 +82,11 @@ class EffectManager{
|
|||||||
$index = spl_object_id($effectType);
|
$index = spl_object_id($effectType);
|
||||||
if(isset($this->effects[$index])){
|
if(isset($this->effects[$index])){
|
||||||
$effect = $this->effects[$index];
|
$effect = $this->effects[$index];
|
||||||
$hasExpired = $effect->hasExpired();
|
|
||||||
$ev = new EntityEffectRemoveEvent($this->entity, $effect);
|
$ev = new EntityEffectRemoveEvent($this->entity, $effect);
|
||||||
$ev->call();
|
$ev->call();
|
||||||
if($ev->isCancelled()){
|
if($ev->isCancelled()){
|
||||||
if($hasExpired && !$ev->getEffect()->hasExpired()){ //altered duration of an expired effect to make it not get removed
|
foreach($this->effectAddHooks as $hook){
|
||||||
foreach($this->effectAddHooks as $hook){
|
$hook($ev->getEffect(), true);
|
||||||
$hook($ev->getEffect(), true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user