mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-09 23:39:43 +00:00
BlockFactory: added getAllKnownStates()
This commit is contained in:
parent
73305a7425
commit
6edd4fd9c7
@ -31,6 +31,7 @@ use pocketmine\block\utils\TreeType;
|
||||
use pocketmine\item\ItemIds;
|
||||
use pocketmine\level\Position;
|
||||
use function array_fill;
|
||||
use function array_filter;
|
||||
use function file_get_contents;
|
||||
use function get_class;
|
||||
use function json_decode;
|
||||
@ -675,4 +676,11 @@ class BlockFactory{
|
||||
self::$legacyIdMap[$staticRuntimeId] = ($legacyId << 4) | $legacyMeta;
|
||||
self::$lastRuntimeId = max(self::$lastRuntimeId, $staticRuntimeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Block[]
|
||||
*/
|
||||
public static function getAllKnownStates() : array{
|
||||
return array_filter(self::$fullList->toArray(), function(?Block $v) : bool{ return $v !== null; });
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user