Return an UnknownBlock if the BlockFactory hasn't been initialized yet

This commit is contained in:
Dylan K. Taylor 2017-08-28 17:07:39 +01:00
parent d07b5ba1e1
commit 37b050f864

View File

@ -375,7 +375,11 @@ class BlockFactory{
}
try{
$block = clone self::$fullList[($id << 4) | $meta];
if(self::$fullList !== null){
$block = clone self::$fullList[($id << 4) | $meta];
}else{
$block = new UnknownBlock($id, $meta);
}
}catch(\RuntimeException $e){
throw new \InvalidArgumentException("Block ID $id is out of bounds");
}