mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Added support for more NBT data, renaming inventories, fixed tags not being saved, added support for tags in /give
This commit is contained in:
@ -34,10 +34,11 @@ use pocketmine\nbt\tag\Byte;
|
||||
use pocketmine\nbt\tag\Compound;
|
||||
use pocketmine\nbt\tag\Enum;
|
||||
use pocketmine\nbt\tag\Short;
|
||||
use pocketmine\nbt\tag\String;
|
||||
use pocketmine\network\Network;
|
||||
use pocketmine\network\protocol\ContainerSetDataPacket;
|
||||
|
||||
class Furnace extends Tile implements InventoryHolder, Container{
|
||||
class Furnace extends Tile implements InventoryHolder, Container, Nameable{
|
||||
/** @var FurnaceInventory */
|
||||
protected $inventory;
|
||||
|
||||
@ -69,6 +70,23 @@ class Furnace extends Tile implements InventoryHolder, Container{
|
||||
}
|
||||
}
|
||||
|
||||
public function getName(){
|
||||
return isset($this->namedtag->CustomName) ? $this->namedtag->CustomName->getValue() : "Chest";
|
||||
}
|
||||
|
||||
public function hasName(){
|
||||
return isset($this->namedtag->CustomName);
|
||||
}
|
||||
|
||||
public function setName($str){
|
||||
if($str === ""){
|
||||
unset($this->namedtag->CustomName);
|
||||
return;
|
||||
}
|
||||
|
||||
$this->namedtag->CustomName = new String("CustomName", $str);
|
||||
}
|
||||
|
||||
public function close(){
|
||||
if($this->closed === false){
|
||||
foreach($this->getInventory()->getViewers() as $player){
|
||||
|
Reference in New Issue
Block a user