mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 11:57:10 +00:00
Player: simplify PlayerItemHeldEvent calling on content change
the second parameter to this callback is the OLD slots, not the changed slots. This means that ALL slots are included, including empty and unchanged slots.
This commit is contained in:
parent
4e777572c9
commit
901449b0b1
@ -335,12 +335,9 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
|
||||
$this->callDummyItemHeldEvent();
|
||||
}
|
||||
},
|
||||
function(Inventory $unused, array $changedSlots) : void{
|
||||
function() : void{
|
||||
$this->setUsingItem(false);
|
||||
$heldSlot = $this->inventory->getHeldItemIndex();
|
||||
if(isset($changedSlots[$heldSlot])){
|
||||
$this->callDummyItemHeldEvent();
|
||||
}
|
||||
$this->callDummyItemHeldEvent();
|
||||
}
|
||||
));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user