Fix Block::get() regression introduced in 02f42eba

This commit is contained in:
Dylan K. Taylor 2017-08-25 18:15:53 +01:00
parent 4ab286a142
commit 1fec16f167

View File

@ -371,12 +371,7 @@ class BlockFactory{
*/
public static function get(int $id, int $meta = 0, Position $pos = null) : Block{
try{
$block = self::$fullList[($id << 4) | $meta];
if($block !== null){
$block = clone $block;
}else{
$block = new UnknownBlock($id, $meta);
}
$block = clone self::$fullList[($id << 4) | $meta];
}catch(\RuntimeException $e){
//TODO: this probably should return null (out of bounds IDs may cause unexpected behaviour)
$block = new UnknownBlock($id, $meta);