mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 20:49:43 +00:00
spooders will not attack players during the day
This commit is contained in:
parent
f4569d6edf
commit
5bd7825736
1 changed files with 3 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
<?php
|
/*-<?php
|
||||||
/**
|
/**
|
||||||
* A Tempt but for Monsters
|
* A Tempt but for Monsters
|
||||||
*/
|
*/
|
||||||
|
|
@ -11,7 +11,7 @@ class TaskAttackPlayer extends TaskTempt
|
||||||
}
|
}
|
||||||
public function onUpdate(EntityAI $ai)
|
public function onUpdate(EntityAI $ai)
|
||||||
{
|
{
|
||||||
if(($this->target instanceof Entity && !$this->target->isPlayer()) || $this->target->distanceSquared($ai->entity) > 100 || $this->target->level->getName() != $ai->entity->level->getName()){
|
if(($ai->entity instanceof Spider && $ai->entity->level->isDay()) || ($this->target instanceof Entity && !$this->target->isPlayer()) || $this->target->distanceSquared($ai->entity) > 100 || $this->target->level->getName() != $ai->entity->level->getName()){
|
||||||
$this->reset();
|
$this->reset();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -28,7 +28,7 @@ class TaskAttackPlayer extends TaskTempt
|
||||||
public function canBeExecuted(EntityAI $ai)
|
public function canBeExecuted(EntityAI $ai)
|
||||||
{
|
{
|
||||||
$target = $this->findTarget($ai->entity, 10);
|
$target = $this->findTarget($ai->entity, 10);
|
||||||
if($target instanceof Entity && $target->class === ENTITY_PLAYER && $target->isPlayer()){
|
if(($ai->entity instanceof Spider && !$ai->entity->level->isDay()) || $target instanceof Entity && $target->class === ENTITY_PLAYER && $target->isPlayer()){
|
||||||
$this->target = $target; //TODO get rid of it
|
$this->target = $target; //TODO get rid of it
|
||||||
$ai->entity->target = $target;
|
$ai->entity->target = $target;
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue