Item: Remove "ench" tag when all enchantments are removed from an item (#4184)

fixes #4144
This commit is contained in:
TheNewHEROBRINEX
2021-04-18 21:56:07 +02:00
committed by GitHub
parent 6f80b8979d
commit 8d1a1628de
3 changed files with 23 additions and 1 deletions

View File

@ -339,7 +339,11 @@ class Item implements ItemIds, \JsonSerializable{
}
}
$this->setNamedTagEntry($ench);
if($ench->getCount() > 0){
$this->setNamedTagEntry($ench);
}else{
$this->removeNamedTagEntry(self::TAG_ENCH);
}
}
public function removeEnchantments() : void{