mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 00:29:54 +00:00
Added UnknownBlock class, fixed not-yet-added blocks in imported worlds killing people, close #181
This commit is contained in:
parent
e2cdd9eddc
commit
c6cf3458de
@ -276,7 +276,7 @@ class Block extends Position implements BlockIds, Metadatable{
|
|||||||
}else{
|
}else{
|
||||||
self::$lightFilter[$id] = 1;
|
self::$lightFilter[$id] = 1;
|
||||||
for($data = 0; $data < 16; ++$data){
|
for($data = 0; $data < 16; ++$data){
|
||||||
self::$fullList[($id << 4) | $data] = new Block($id, $data);
|
self::$fullList[($id << 4) | $data] = new UnknownBlock($id, $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -296,10 +296,10 @@ class Block extends Position implements BlockIds, Metadatable{
|
|||||||
if($block !== null){
|
if($block !== null){
|
||||||
$block = new $block($meta);
|
$block = new $block($meta);
|
||||||
}else{
|
}else{
|
||||||
$block = new Block($id, $meta);
|
$block = new UnknownBlock($id, $meta);
|
||||||
}
|
}
|
||||||
}catch(\RuntimeException $e){
|
}catch(\RuntimeException $e){
|
||||||
$block = new Block($id, $meta);
|
$block = new UnknownBlock($id, $meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($pos !== null){
|
if($pos !== null){
|
||||||
|
28
src/pocketmine/block/UnknownBlock.php
Normal file
28
src/pocketmine/block/UnknownBlock.php
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* @author PocketMine Team
|
||||||
|
* @link http://www.pocketmine.net/
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
namespace pocketmine\block;
|
||||||
|
|
||||||
|
|
||||||
|
class UnknownBlock extends Flowable{
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user