mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-13 13:25:16 +00:00
Living: fixed turtle helmet being non-removable and spamming inventory updates
closes #5786
This commit is contained in:
parent
30db658d70
commit
0051b34797
@ -637,12 +637,15 @@ abstract class Living extends Entity{
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach($this->armorInventory->getContents() as $index => $item){
|
foreach($this->armorInventory->getContents() as $index => $item){
|
||||||
|
$oldItem = clone $item;
|
||||||
if($item->onTickWorn($this)){
|
if($item->onTickWorn($this)){
|
||||||
$hasUpdate = true;
|
$hasUpdate = true;
|
||||||
|
if(!$item->equalsExact($oldItem)){
|
||||||
$this->armorInventory->setItem($index, $item);
|
$this->armorInventory->setItem($index, $item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if($this->attackTime > 0){
|
if($this->attackTime > 0){
|
||||||
$this->attackTime -= $tickDiff;
|
$this->attackTime -= $tickDiff;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user