mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 09:19:42 +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?
|
if(!$this->inventory->isHotbarSlot($hotbarSlot)){ //TODO: exception here?
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if($hotbarSlot === $this->inventory->getHeldItemIndex()){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
$ev = new PlayerItemHeldEvent($this, $this->inventory->getItem($hotbarSlot), $hotbarSlot);
|
$ev = new PlayerItemHeldEvent($this, $this->inventory->getItem($hotbarSlot), $hotbarSlot);
|
||||||
$ev->call();
|
$ev->call();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user