mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Added Tile::saveNBT(), moved Player::broadcastPacket() to Server
This commit is contained in:
@ -26,8 +26,10 @@ use pocketmine\inventory\FurnaceInventory;
|
||||
use pocketmine\inventory\InventoryHolder;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\level\Level;
|
||||
use pocketmine\nbt\NBT;
|
||||
use pocketmine\nbt\tag\Byte;
|
||||
use pocketmine\nbt\tag\Compound;
|
||||
use pocketmine\nbt\tag\Enum;
|
||||
use pocketmine\nbt\tag\Short;
|
||||
|
||||
class Furnace extends Tile implements InventoryHolder, Container{
|
||||
@ -57,6 +59,14 @@ class Furnace extends Tile implements InventoryHolder, Container{
|
||||
}
|
||||
}
|
||||
|
||||
public function saveNBT(){
|
||||
$this->namedtag->Inventory = new Enum("Inventory", []);
|
||||
$this->namedtag->Inventory->setTagType(NBT::TAG_Compound);
|
||||
for($index = 0; $index < $this->getSize(); ++$index){
|
||||
$this->setItem($index, $this->inventory->getItem($index));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
|
Reference in New Issue
Block a user