mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 16:24:05 +00:00
Player: fixed self-defeating condition in item consuming
this was giving players infinite food and potions.
This commit is contained in:
parent
6a1f551aab
commit
28335e3c45
@ -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());
|
||||
|
Loading…
x
Reference in New Issue
Block a user