mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-19 15:35:52 +00:00
Better block creation on Level
This commit is contained in:
parent
3bb2f12cde
commit
5e5f8bf33d
@ -758,12 +758,6 @@ class Block extends Position implements Metadatable{
|
||||
self::$lightFilter[$id] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
foreach(self::$fullList as $id => $block){
|
||||
if($block === null){
|
||||
self::$fullList[$id] = new Block($id >> 4, $id & 0x0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -923,7 +923,13 @@ class Level implements ChunkManager, Metadatable{
|
||||
$fullState = $chunk->getFullBlock($pos->x & 0x0f, $pos->y, $pos->z & 0x0f);
|
||||
}
|
||||
|
||||
$block = clone Block::$fullList[$fullState];
|
||||
$block = Block::$fullList[$fullState];
|
||||
if($block !== null){
|
||||
$block = new $block($fullState & 0x0f);
|
||||
}else{
|
||||
$block = new Block($fullState >> 4, $fullState & 0x0f);
|
||||
}
|
||||
|
||||
$block->x = $pos->x;
|
||||
$block->y = $pos->y;
|
||||
$block->z = $pos->z;
|
||||
|
Loading…
x
Reference in New Issue
Block a user