*/ private static function loadCompoundFromFile(string $filePath) : CacheableNbt{ $rawNbt = @file_get_contents($filePath); if($rawNbt === false) throw new \RuntimeException("Failed to read file"); return new CacheableNbt((new NetworkNbtSerializer())->read($rawNbt)->mustGetCompoundTag()); } private static function make() : self{ return new self( BiomeDefinitionListPacket::create(self::loadCompoundFromFile(Path::join(\pocketmine\RESOURCE_PATH, 'vanilla', 'biome_definitions.nbt'))), AvailableActorIdentifiersPacket::create(self::loadCompoundFromFile(Path::join(\pocketmine\RESOURCE_PATH, 'vanilla', 'entity_identifiers.nbt'))) ); } public function __construct(BiomeDefinitionListPacket $biomeDefs, AvailableActorIdentifiersPacket $availableActorIdentifiers){ $this->biomeDefs = $biomeDefs; $this->availableActorIdentifiers = $availableActorIdentifiers; } public function getBiomeDefs() : BiomeDefinitionListPacket{ return $this->biomeDefs; } public function getAvailableActorIdentifiers() : AvailableActorIdentifiersPacket{ return $this->availableActorIdentifiers; } }