mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Return an UnknownBlock if the BlockFactory hasn't been initialized yet
This commit is contained in:
parent
d07b5ba1e1
commit
37b050f864
@ -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");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user