38 public function clearSpawnCompoundCache() :
void{
39 $this->spawnCompoundCache =
null;
65 if($this->spawnCompoundCache === null){
66 $this->spawnCompoundCache =
new CacheableNbt($this->getSpawnCompound());
69 return $this->spawnCompoundCache;
72 final public function getSpawnCompound() :
CompoundTag{
74 ->setString(self::TAG_ID, TileFactory::getInstance()->getSaveId(get_class($this)))
75 ->setInt(self::TAG_X, $this->position->x)
76 ->setInt(self::TAG_Y, $this->position->y)
77 ->setInt(self::TAG_Z, $this->position->z);
78 $this->addAdditionalSpawnData($nbt);