mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 23:15:29 +00:00
Fix Block::get() regression introduced in 02f42eba
This commit is contained in:
parent
4ab286a142
commit
1fec16f167
@ -371,12 +371,7 @@ class BlockFactory{
|
|||||||
*/
|
*/
|
||||||
public static function get(int $id, int $meta = 0, Position $pos = null) : Block{
|
public static function get(int $id, int $meta = 0, Position $pos = null) : Block{
|
||||||
try{
|
try{
|
||||||
$block = self::$fullList[($id << 4) | $meta];
|
$block = clone self::$fullList[($id << 4) | $meta];
|
||||||
if($block !== null){
|
|
||||||
$block = clone $block;
|
|
||||||
}else{
|
|
||||||
$block = new UnknownBlock($id, $meta);
|
|
||||||
}
|
|
||||||
}catch(\RuntimeException $e){
|
}catch(\RuntimeException $e){
|
||||||
//TODO: this probably should return null (out of bounds IDs may cause unexpected behaviour)
|
//TODO: this probably should return null (out of bounds IDs may cause unexpected behaviour)
|
||||||
$block = new UnknownBlock($id, $meta);
|
$block = new UnknownBlock($id, $meta);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user