Removed InventoryType, added new inventory API methods

This commit is contained in:
Dylan K. Taylor
2017-08-07 11:31:36 +01:00
parent 899e318a88
commit 98e0a2ecba
13 changed files with 115 additions and 264 deletions

View File

@ -34,6 +34,7 @@ use pocketmine\network\mcpe\protocol\MobArmorEquipmentPacket;
use pocketmine\network\mcpe\protocol\MobEquipmentPacket;
use pocketmine\network\mcpe\protocol\PlayerHotbarPacket;
use pocketmine\network\mcpe\protocol\types\ContainerIds;
use pocketmine\network\mcpe\protocol\types\WindowTypes;
use pocketmine\Player;
use pocketmine\Server;
@ -45,7 +46,19 @@ class PlayerInventory extends BaseInventory{
public function __construct(Human $player){
$this->resetHotbar(false);
parent::__construct($player, InventoryType::get(InventoryType::PLAYER));
parent::__construct($player);
}
public function getNetworkType() : int{
return WindowTypes::INVENTORY;
}
public function getName() : string{
return "Player";
}
public function getDefaultSize() : int{
return 40; //36 inventory, 4 armor
}
public function getSize() : int{