*/ 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\BEDROCK_DATA_PATH, 'biome_definitions.nbt'))), AvailableActorIdentifiersPacket::create(self::loadCompoundFromFile(Path::join(\pocketmine\BEDROCK_DATA_PATH, 'entity_identifiers.nbt'))) ); } public function __construct( private BiomeDefinitionListPacket $biomeDefs, private AvailableActorIdentifiersPacket $availableActorIdentifiers ){} public function getBiomeDefs() : BiomeDefinitionListPacket{ return $this->biomeDefs; } public function getAvailableActorIdentifiers() : AvailableActorIdentifiersPacket{ return $this->availableActorIdentifiers; } }