Skip to content
This repository was archived by the owner on Feb 8, 2019. It is now read-only.

Commit 18141e9

Browse files
committed
Fix bugs
1 parent 658e3a2 commit 18141e9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/VectorNetworkProject/TheMix/event/entity/TheEntityDamageEvent.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public function event(EntityDamageEvent $event)
2929
$entity = $event->getEntity();
3030
$entity->extinguish();
3131
if (TheEndGameEvent::isFinish()) {
32+
$event->setCancelled();
33+
3234
return;
3335
}
3436
if (!$entity instanceof Player) {
@@ -38,10 +40,14 @@ public function event(EntityDamageEvent $event)
3840
return;
3941
}
4042
if ($event->getCause() === EntityDamageEvent::CAUSE_FALL) {
43+
$event->setCancelled();
44+
4145
return;
4246
}
4347
if ($entity->getLevel()->getName() === Server::getInstance()->getDefaultLevel()->getName()) {
4448
$event->setCancelled();
49+
50+
return;
4551
}
4652
if ($event instanceof EntityDamageByEntityEvent) {
4753
$event->setCancelled();

0 commit comments

Comments
 (0)