Added tagType parameter to ListTag constructor, remove some boilerplate code

This commit is contained in:
Dylan K. Taylor
2017-10-08 13:28:01 +01:00
parent 69e29236aa
commit 8fafef2f7f
9 changed files with 25 additions and 40 deletions

View File

@ -470,8 +470,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
$this->namedtag->foodSaturationLevel = new FloatTag("foodSaturationLevel", $this->getSaturation());
$this->namedtag->foodTickTimer = new IntTag("foodTickTimer", $this->foodTickTimer);
$this->namedtag->Inventory = new ListTag("Inventory", []);
$this->namedtag->Inventory->setTagType(NBT::TAG_Compound);
$this->namedtag->Inventory = new ListTag("Inventory", [], NBT::TAG_Compound);
if($this->inventory !== null){
//Normal inventory
$slotCount = $this->inventory->getSize() + $this->inventory->getHotbarSize();