mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Updated protocol details, anvil menu creation
This commit is contained in:
@ -21,28 +21,27 @@
|
||||
|
||||
namespace pocketmine\inventory;
|
||||
|
||||
use pocketmine\level\Level;
|
||||
use pocketmine\level\Position;
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\Network;
|
||||
use pocketmine\network\protocol\TileEventPacket;
|
||||
use pocketmine\Player;
|
||||
use pocketmine\Server;
|
||||
use pocketmine\tile\Chest;
|
||||
|
||||
class AnvilInventory extends ContainerInventory implements InventoryHolder{
|
||||
class AnvilInventory extends ContainerInventory{
|
||||
public function __construct(Position $pos){
|
||||
parent::__construct($this, InventoryType::get(InventoryType::ANVIL));
|
||||
}
|
||||
|
||||
public function getInventory(){
|
||||
return $this;
|
||||
parent::__construct(new FakeBlockMenu($this, $pos), InventoryType::get(InventoryType::ANVIL));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return AnvilInventory
|
||||
* @return FakeBlockMenu
|
||||
*/
|
||||
public function getHolder(){
|
||||
return $this->holder;
|
||||
}
|
||||
|
||||
public function onClose(Player $who){
|
||||
parent::onClose($who);
|
||||
|
||||
for($i = 0; $i < 2; ++$i){
|
||||
$this->getHolder()->getLevel()->dropItem($this->getHolder()->add(0.5, 0.5, 0.5), $this->getItem($i));
|
||||
$this->clear($i);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user