Player: fixed self-defeating condition in item consuming

this was giving players infinite food and potions.
This commit is contained in:
Dylan K. Taylor 2020-11-17 20:23:33 +00:00
parent 6a1f551aab
commit 28335e3c45

View File

@ -1495,7 +1495,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
$this->setUsingItem(false);
$this->resetItemCooldown($slot);
if($this->hasFiniteResources() and !$slot->equalsExact($oldItem) and $oldItem->equalsExact($this->inventory->getItemInHand())){
if($this->hasFiniteResources() && $oldItem->equalsExact($this->inventory->getItemInHand())){
$slot->pop();
$this->inventory->setItemInHand($slot);
$this->inventory->addItem($slot->getResidue());