mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 00:29:54 +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{
|
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){
|
}catch(\RuntimeException $e){
|
||||||
throw new \InvalidArgumentException("Block ID $id is out of bounds");
|
throw new \InvalidArgumentException("Block ID $id is out of bounds");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user