mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 19:02:59 +00:00
Tiles now encapsulate positions instead of extending them
This commit is contained in:
@ -57,10 +57,10 @@ class Furnace extends Spawnable implements Container, Nameable{
|
||||
|
||||
public function __construct(World $world, Vector3 $pos){
|
||||
parent::__construct($world, $pos);
|
||||
$this->inventory = new FurnaceInventory($this);
|
||||
$this->inventory = new FurnaceInventory($this->pos);
|
||||
$this->inventory->addChangeListeners(CallbackInventoryChangeListener::onAnyChange(
|
||||
function(Inventory $unused) : void{
|
||||
$this->world->scheduleDelayedBlockUpdate($this->asVector3(), 1);
|
||||
$this->pos->getWorld()->scheduleDelayedBlockUpdate($this->pos, 1);
|
||||
})
|
||||
);
|
||||
}
|
||||
@ -132,7 +132,7 @@ class Furnace extends Spawnable implements Container, Nameable{
|
||||
$block = $this->getBlock();
|
||||
if($block instanceof BlockFurnace and !$block->isLit()){
|
||||
$block->setLit(true);
|
||||
$this->getWorld()->setBlock($block->getPos(), $block);
|
||||
$this->pos->getWorld()->setBlock($block->getPos(), $block);
|
||||
}
|
||||
|
||||
if($this->remainingFuelTime > 0 and $ev->isBurning()){
|
||||
@ -158,7 +158,7 @@ class Furnace extends Spawnable implements Container, Nameable{
|
||||
$fuel = $this->inventory->getFuel();
|
||||
$raw = $this->inventory->getSmelting();
|
||||
$product = $this->inventory->getResult();
|
||||
$smelt = $this->world->getServer()->getCraftingManager()->matchFurnaceRecipe($raw);
|
||||
$smelt = $this->pos->getWorld()->getServer()->getCraftingManager()->matchFurnaceRecipe($raw);
|
||||
$canSmelt = ($smelt instanceof FurnaceRecipe and $raw->getCount() > 0 and (($smelt->getResult()->equals($product) and $product->getCount() < $product->getMaxStackSize()) or $product->isNull()));
|
||||
|
||||
if($this->remainingFuelTime <= 0 and $canSmelt and $fuel->getFuelTime() > 0 and $fuel->getCount() > 0){
|
||||
@ -195,7 +195,7 @@ class Furnace extends Spawnable implements Container, Nameable{
|
||||
$block = $this->getBlock();
|
||||
if($block instanceof BlockFurnace and $block->isLit()){
|
||||
$block->setLit(false);
|
||||
$this->getWorld()->setBlock($block->getPos(), $block);
|
||||
$this->pos->getWorld()->setBlock($block->getPos(), $block);
|
||||
}
|
||||
$this->remainingFuelTime = $this->cookTime = $this->maxFuelTime = 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user