mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-19 15:35:52 +00:00
Added Furnace progress fire
This commit is contained in:
parent
69800c6d79
commit
b542c5b9bd
@ -32,6 +32,7 @@ use pocketmine\nbt\tag\Byte;
|
||||
use pocketmine\nbt\tag\Compound;
|
||||
use pocketmine\nbt\tag\Enum;
|
||||
use pocketmine\nbt\tag\Short;
|
||||
use pocketmine\network\protocol\ContainerSetDataPacket;
|
||||
|
||||
class Furnace extends Tile implements InventoryHolder, Container{
|
||||
/** @var FurnaceInventory */
|
||||
@ -218,6 +219,24 @@ class Furnace extends Tile implements InventoryHolder, Container{
|
||||
$this->namedtag->BurnTicks = new Short("BurnTicks", 0);
|
||||
}
|
||||
|
||||
foreach($this->getInventory()->getViewers() as $player){
|
||||
$windowId = $player->getWindowId($this->getInventory());
|
||||
if($windowId > 0){
|
||||
$pk = new ContainerSetDataPacket;
|
||||
$pk->windowid = $windowId;
|
||||
$pk->property = 0; //Smelting
|
||||
$pk->value = floor($this->namedtag["CookTime"]);
|
||||
$player->dataPacket($pk);
|
||||
|
||||
$pk = new ContainerSetDataPacket;
|
||||
$pk->windowid = $windowId;
|
||||
$pk->property = 1; //Fire icon
|
||||
$pk->value = $this->namedtag["BurnTicks"];
|
||||
$player->dataPacket($pk);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$this->lastUpdate = microtime(true);
|
||||
|
||||
return $ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user