Tile: remove createNBT(), add create(), createFromData(), createFromItem()

This commit is contained in:
Dylan K. Taylor
2018-12-10 19:40:37 +00:00
parent 6dbceda3e8
commit d72e4cb9a1
15 changed files with 105 additions and 95 deletions

View File

@ -206,6 +206,20 @@ class Banner extends Item{
return $this->getNamedTag()->getListTag(self::TAG_PATTERNS)->count();
}
/**
* @return ListTag|null
*/
public function getPatterns() : ?ListTag{
return $this->getNamedTag()->getListTag(self::TAG_PATTERNS);
}
/**
* @param ListTag $patterns
*/
public function setPatterns(ListTag $patterns) : void{
$this->setNamedTagEntry(clone $patterns);
}
public function correctNBT() : void{
$tag = $this->getNamedTag();
if(!$tag->hasTag(self::TAG_BASE, IntTag::class)){