diff --git a/src/pocketmine/Server.php b/src/pocketmine/Server.php index f90556ee1..10b471595 100644 --- a/src/pocketmine/Server.php +++ b/src/pocketmine/Server.php @@ -1633,6 +1633,7 @@ class Server{ Entity::init(); Tile::init(); BlockFactory::init(); + BlockFactory::registerStaticRuntimeIdMappings(); Enchantment::init(); ItemFactory::init(); Item::initCreativeItems(); diff --git a/src/pocketmine/block/BlockFactory.php b/src/pocketmine/block/BlockFactory.php index 237224b41..0cc88463e 100644 --- a/src/pocketmine/block/BlockFactory.php +++ b/src/pocketmine/block/BlockFactory.php @@ -323,12 +323,6 @@ class BlockFactory{ //TODO: STRUCTURE_BLOCK //TODO: RESERVED6 - - /** @var mixed[] $runtimeIdMap */ - $runtimeIdMap = json_decode(file_get_contents(\pocketmine\RESOURCE_PATH . "runtimeid_table.json"), true); - foreach($runtimeIdMap as $obj){ - self::registerMapping($obj["runtimeID"], $obj["id"], $obj["data"]); - } } /** @@ -419,6 +413,14 @@ class BlockFactory{ return $b !== null and !($b instanceof UnknownBlock); } + public static function registerStaticRuntimeIdMappings() : void{ + /** @var mixed[] $runtimeIdMap */ + $runtimeIdMap = json_decode(file_get_contents(\pocketmine\RESOURCE_PATH . "runtimeid_table.json"), true); + foreach($runtimeIdMap as $obj){ + self::registerMapping($obj["runtimeID"], $obj["id"], $obj["data"]); + } + } + /** * @internal *