mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
fixed target invalidation for 2 tasks
This commit is contained in:
parent
773e18282c
commit
b81438ee23
5 changed files with 24 additions and 9 deletions
|
|
@ -8,9 +8,16 @@ class Monster extends Creature{
|
|||
public function getAttackDamage(){
|
||||
return 2;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see Entity::attackEntity()
|
||||
*/
|
||||
public function attackEntity($entity, $distance){
|
||||
$entity->harm($this->getAttackDamage(), $this->eid);
|
||||
return true;
|
||||
if($distance < 2.0 && $entity->boundingBox->maxX > $this->boundingBox->minY && $entity->boundingBox->minY < $this->boundingBox->maxY){
|
||||
$entity->harm($this->getAttackDamage(), $this->eid);
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue