BlockFactory: partial revert of 515e4aabc45c057e215e5f695a94a7bd7b0e1094

it's necessary to register these to fill the static property arrays. Someday these won't be necessary I hope...
This commit is contained in:
Dylan K. Taylor 2018-06-01 17:08:58 +01:00
parent 6047810113
commit ec28612a12

View File

@ -323,6 +323,12 @@ class BlockFactory{
//TODO: STRUCTURE_BLOCK //TODO: STRUCTURE_BLOCK
//TODO: RESERVED6 //TODO: RESERVED6
for($id = 0, $size = self::$fullList->getSize() >> 4; $id < $size; ++$id){
if(self::$fullList[$id << 4] === null){
self::registerBlock(new UnknownBlock($id));
}
}
} }
/** /**
@ -375,8 +381,8 @@ class BlockFactory{
} }
try{ try{
if(self::$fullList !== null and self::$fullList[$idx = ($id << 4) | $meta] !== null){ if(self::$fullList !== null){
$block = clone self::$fullList[$idx]; $block = clone self::$fullList[($id << 4) | $meta];
}else{ }else{
$block = new UnknownBlock($id, $meta); $block = new UnknownBlock($id, $meta);
} }