Make tiles less dependent on runtime NBT, use properties instead

This will ultimately culminate in the complete removal of runtime NBT, so plugins should also follow these steps if they have custom data.
This commit is contained in:
Dylan K. Taylor
2018-06-03 12:50:16 +01:00
parent 1bb0337420
commit 6aaaaefd2f
8 changed files with 153 additions and 104 deletions

View File

@ -92,8 +92,8 @@ class StandingBanner extends Transparent{
$tile = $this->level->getTile($this);
$drop = ItemFactory::get(Item::BANNER, ($tile instanceof TileBanner ? $tile->getBaseColor() : 0));
if($tile instanceof TileBanner and ($patterns = $tile->namedtag->getListTag(TileBanner::TAG_PATTERNS)) !== null and !$patterns->empty()){
$drop->setNamedTagEntry($patterns);
if($tile instanceof TileBanner and !($patterns = $tile->getPatterns())->empty()){
$drop->setNamedTagEntry(clone $patterns);
}
return [$drop];