Only spawn break particles when needed

This commit is contained in:
Shoghi Cervantes
2015-06-07 12:33:53 +02:00
parent 383fcba8e1
commit d881dbf1a2
2 changed files with 17 additions and 14 deletions

View File

@ -2197,7 +2197,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
$oldItem = clone $item;
if($this->canInteract($vector->add(0.5, 0.5, 0.5), 13) and $this->level->useBreakOn($vector, $item, $this) === true){
if($this->canInteract($vector->add(0.5, 0.5, 0.5), 13) and $this->level->useBreakOn($vector, $item, $this, true)){
if($this->isSurvival()){
if(!$item->equals($oldItem, true) or $item->getCount() !== $oldItem->getCount()){
$this->inventory->setItemInHand($item, $this);