Make use of CompoundTag->hasTag()

This commit is contained in:
Dylan K. Taylor
2017-10-16 18:32:08 +01:00
parent 292e462ea0
commit 28a840d161
7 changed files with 17 additions and 17 deletions

View File

@ -51,7 +51,7 @@ class Chest extends Spawnable implements InventoryHolder, Container, Nameable{
parent::__construct($level, $nbt);
$this->inventory = new ChestInventory($this);
if(!($this->namedtag->getTag("Items") instanceof ListTag)){
if(!$this->namedtag->hasTag("Items", ListTag::class)){
$this->namedtag->setTag(new ListTag("Items", [], NBT::TAG_Compound));
}