mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 16:59:44 +00:00
Player: don't fire events on equipItem() when sending the same slot
This commit is contained in:
parent
ee72680f44
commit
eee039a490
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user