From cf18db3b658e2cf24030e96c9ece4974a6b1d171 Mon Sep 17 00:00:00 2001 From: NLOG Date: Sat, 28 Apr 2018 21:09:55 +0900 Subject: [PATCH 1/4] Monster can't attack creative(spectator) player --- src/revivalpmmp/pureentities/entity/monster/WalkingMonster.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/revivalpmmp/pureentities/entity/monster/WalkingMonster.php b/src/revivalpmmp/pureentities/entity/monster/WalkingMonster.php index f9663821..3b918e77 100644 --- a/src/revivalpmmp/pureentities/entity/monster/WalkingMonster.php +++ b/src/revivalpmmp/pureentities/entity/monster/WalkingMonster.php @@ -69,6 +69,9 @@ public function checkAndAttackEntity(Entity $player){ return; } } + if(!$player->isSurvival()) { + return; + } $this->attackEntity($player); } From 28d3a119f29bf0eedc3ba37c54145ce28a1e6dcd Mon Sep 17 00:00:00 2001 From: NLOG Date: Fri, 18 May 2018 07:42:30 +0900 Subject: [PATCH 2/4] Update JumpingMonster.php --- src/revivalpmmp/pureentities/entity/monster/JumpingMonster.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/revivalpmmp/pureentities/entity/monster/JumpingMonster.php b/src/revivalpmmp/pureentities/entity/monster/JumpingMonster.php index abd9711b..d20a4caa 100644 --- a/src/revivalpmmp/pureentities/entity/monster/JumpingMonster.php +++ b/src/revivalpmmp/pureentities/entity/monster/JumpingMonster.php @@ -126,6 +126,9 @@ public function onUpdate(int $currentTick) : bool{ $this->entityBaseTick($tickDiff); $target = $this->updateMove($tickDiff); + if($player instanceof Player && !$player->isSurvival()) { + return true; + } if($this->isFriendly()){ if(!($target instanceof Player)){ if($target instanceof Entity){ From 1459302e44a151fc6fda27b40dd7f735ee0c9c2f Mon Sep 17 00:00:00 2001 From: NLOG Date: Fri, 18 May 2018 07:44:08 +0900 Subject: [PATCH 3/4] Update FlyingMonster.php --- src/revivalpmmp/pureentities/entity/monster/FlyingMonster.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/revivalpmmp/pureentities/entity/monster/FlyingMonster.php b/src/revivalpmmp/pureentities/entity/monster/FlyingMonster.php index 283fe71e..9b52d7db 100644 --- a/src/revivalpmmp/pureentities/entity/monster/FlyingMonster.php +++ b/src/revivalpmmp/pureentities/entity/monster/FlyingMonster.php @@ -126,6 +126,9 @@ public function onUpdate(int $currentTick) : bool{ $this->entityBaseTick($tickDiff); $target = $this->updateMove($tickDiff); + if($player instanceof Player && !$player->isSurvival()) { + return true; + } if($target instanceof Player){ $this->attackEntity($target); }elseif( From 4a9e2d5eb6a36cdbe3fc0d35c7031ecb468e16b4 Mon Sep 17 00:00:00 2001 From: NLOG Date: Fri, 18 May 2018 07:44:24 +0900 Subject: [PATCH 4/4] Update SwimmingMonster.php --- .../pureentities/entity/monster/SwimmingMonster.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/revivalpmmp/pureentities/entity/monster/SwimmingMonster.php b/src/revivalpmmp/pureentities/entity/monster/SwimmingMonster.php index 202d5e4c..eac01d20 100644 --- a/src/revivalpmmp/pureentities/entity/monster/SwimmingMonster.php +++ b/src/revivalpmmp/pureentities/entity/monster/SwimmingMonster.php @@ -126,6 +126,9 @@ public function onUpdate(int $currentTick) : bool{ $this->entityBaseTick($tickDiff); $target = $this->updateMove($tickDiff); + if($player instanceof Player && !$player->isSurvival()) { + return true; + } if($this->isFriendly()){ if(!($target instanceof Player)){ if($target instanceof Entity){