mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Player: don't fire events on equipItem() when sending the same slot
This commit is contained in:
@ -1652,6 +1652,9 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener,
|
||||
if(!$this->inventory->isHotbarSlot($hotbarSlot)){ //TODO: exception here?
|
||||
return false;
|
||||
}
|
||||
if($hotbarSlot === $this->inventory->getHeldItemIndex()){
|
||||
return true;
|
||||
}
|
||||
|
||||
$ev = new PlayerItemHeldEvent($this, $this->inventory->getItem($hotbarSlot), $hotbarSlot);
|
||||
$ev->call();
|
||||
|
Reference in New Issue
Block a user