mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-17 11:18:52 +00:00
Added Lave Bucket as Fuel Check
This commit is contained in:
parent
45ee7ea7ae
commit
67919a68e1
@ -89,18 +89,22 @@ class Tile extends Position{
|
|||||||
$product = $this->getSlot(2);
|
$product = $this->getSlot(2);
|
||||||
$smelt = $raw->getSmeltItem();
|
$smelt = $raw->getSmeltItem();
|
||||||
$canSmelt = $smelt !== false and $raw->count > 0 and (($product->getID() === $smelt->getID() and $product->getMetadata() === $smelt->getMetadata() and $product->count < $product->getMaxStackSize()) or $product->getID() === AIR);
|
$canSmelt = $smelt !== false and $raw->count > 0 and (($product->getID() === $smelt->getID() and $product->getMetadata() === $smelt->getMetadata() and $product->count < $product->getMaxStackSize()) or $product->getID() === AIR);
|
||||||
if($this->data["BurnTime"] <= 0 and $canSmelt and $fuel->getFuelTime() !== false and $fuel->count > 0){
|
if($this->data["BurnTime"] <= 0 and $canSmelt and $fuel->getFuelTime() !== false and $fuel->count > 0)
|
||||||
$this->lastUpdate = microtime(true);
|
{
|
||||||
$this->data["MaxTime"] = $this->data["BurnTime"] = floor($fuel->getFuelTime() * 20);
|
if(!($fuel->getID === BUCKET and $fuel->getMetaData() !== LAVA))
|
||||||
$this->data["BurnTicks"] = 0;
|
{
|
||||||
--$fuel->count;
|
$this->lastUpdate = microtime(true);
|
||||||
if($fuel->count === 0){
|
$this->data["MaxTime"] = $this->data["BurnTime"] = floor($fuel->getFuelTime() * 20);
|
||||||
$fuel = BlockAPI::getItem(AIR, 0, 0);
|
$this->data["BurnTicks"] = 0;
|
||||||
}
|
--$fuel->count;
|
||||||
$this->setSlot(1, $fuel, false);
|
if($fuel->count === 0){
|
||||||
$current = $this->level->getBlock($this);
|
$fuel = BlockAPI::getItem(AIR, 0, 0);
|
||||||
if($current->getID() === FURNACE){
|
}
|
||||||
$this->level->setBlock($this, BlockAPI::get(BURNING_FURNACE, $current->getMetadata()));
|
$this->setSlot(1, $fuel, false);
|
||||||
|
$current = $this->level->getBlock($this);
|
||||||
|
if($current->getID() === FURNACE){
|
||||||
|
$this->level->setBlock($this, BlockAPI::get(BURNING_FURNACE, $current->getMetadata()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($this->data["BurnTime"] > 0){
|
if($this->data["BurnTime"] > 0){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user