Move block registration to its own class

This commit is contained in:
Dylan K. Taylor
2017-08-20 18:05:01 +01:00
committed by GitHub
parent 9451dd361e
commit 02f42eba48
62 changed files with 560 additions and 482 deletions

View File

@ -26,7 +26,7 @@ declare(strict_types=1);
namespace pocketmine\level\format;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\entity\Entity;
use pocketmine\level\Level;
use pocketmine\nbt\NBT;
@ -438,7 +438,7 @@ class Chunk{
public function recalculateHeightMapColumn(int $x, int $z) : int{
$max = $this->getHighestBlockAt($x, $z);
for($y = $max; $y >= 0; --$y){
if(Block::$lightFilter[$id = $this->getBlockId($x, $y, $z)] > 1 or Block::$diffusesSkyLight[$id]){
if(BlockFactory::$lightFilter[$id = $this->getBlockId($x, $y, $z)] > 1 or BlockFactory::$diffusesSkyLight[$id]){
break;
}
}
@ -470,7 +470,7 @@ class Chunk{
$light = 15;
for(; $y >= 0; --$y){
if($light > 0){
$light -= Block::$lightFilter[$this->getBlockId($x, $y, $z)];
$light -= BlockFactory::$lightFilter[$this->getBlockId($x, $y, $z)];
if($light <= 0){
break;
}