avoid direct mutation of Item->count field, use Item->pop() instead

I think this change was already applied on the master branch, but I don't remember for sure.
This commit is contained in:
Dylan K. Taylor
2020-02-23 17:37:25 +00:00
parent 50fcdd6e7e
commit 2d7f37ac47
7 changed files with 7 additions and 7 deletions

View File

@ -44,7 +44,7 @@ class SpawnEgg extends Item{
$entity = Entity::createEntity($this->meta, $player->getLevel(), $nbt);
if($entity instanceof Entity){
--$this->count;
$this->pop();
$entity->spawnToAll();
return true;
}