mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
fixed spam in console
This commit is contained in:
parent
a2747dffa8
commit
a52e38de5d
2 changed files with 2 additions and 2 deletions
|
|
@ -947,7 +947,7 @@ class Entity extends Position
|
|||
$slot = $e->player->getHeldItem();
|
||||
$damage = $slot->getDamageAgainstOf($this);
|
||||
$this->harm($damage, $e->eid);
|
||||
if($slot->isTool() and ($this->player->gamemode & 0x01) === 0){
|
||||
if($slot->isTool() && (!$this->isPlayer() || ($this->player->gamemode & 0x01) === 0)){
|
||||
if($slot->useOn($this) and $slot->getMetadata() >= $slot->getMaxDurability()){
|
||||
$e->player->removeItem($slot->getID(), $slot->getMetadata(), 1, true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class TaskRangedAttack extends \TaskBase
|
|||
}
|
||||
}
|
||||
|
||||
$closestTarget = $e->closestPlayerDist <= $this->rangeSquared ? $e->level->entityList[$e->closestPlayerEID] : null;
|
||||
$closestTarget = $e->closestPlayerDist <= $this->rangeSquared ? ($e->level->entityList[$e->closestPlayerEID] ?? null) : null;
|
||||
|
||||
if($closestTarget != null){
|
||||
$e->target = $closestTarget; //TODO dont save entity object ?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue