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

@ -24,6 +24,7 @@ declare(strict_types=1);
namespace pocketmine\tile;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\event\inventory\FurnaceBurnEvent;
use pocketmine\event\inventory\FurnaceSmeltEvent;
use pocketmine\inventory\FurnaceInventory;
@ -191,7 +192,7 @@ class Furnace extends Spawnable implements InventoryHolder, Container, Nameable{
$this->namedtag->BurnTime->setValue($ev->getBurnTime());
$this->namedtag->BurnTicks = new ShortTag("BurnTicks", 0);
if($this->getBlock()->getId() === Item::FURNACE){
$this->getLevel()->setBlock($this, Block::get(Block::BURNING_FURNACE, $this->getBlock()->getDamage()), true);
$this->getLevel()->setBlock($this, BlockFactory::get(Block::BURNING_FURNACE, $this->getBlock()->getDamage()), true);
}
if($this->namedtag->BurnTime->getValue() > 0 and $ev->isBurning()){
@ -254,7 +255,7 @@ class Furnace extends Spawnable implements InventoryHolder, Container, Nameable{
$ret = true;
}else{
if($this->getBlock()->getId() === Item::BURNING_FURNACE){
$this->getLevel()->setBlock($this, Block::get(Block::FURNACE, $this->getBlock()->getDamage()), true);
$this->getLevel()->setBlock($this, BlockFactory::get(Block::FURNACE, $this->getBlock()->getDamage()), true);
}
$this->namedtag->BurnTime->setValue(0);
$this->namedtag->CookTime->setValue(0);