Moved getNetworkType() to ContainerInventory since it's not used anywhere else

This commit is contained in:
Dylan K. Taylor 2017-09-19 19:57:22 +01:00
parent 1fb6d12a6b
commit 90fb3c5e12
4 changed files with 6 additions and 19 deletions

View File

@ -70,14 +70,6 @@ abstract class BaseInventory implements Inventory{
return $this->title;
}
/**
* Returns the Minecraft PE inventory type used to show the inventory window to clients.
* @return int
*/
public function getNetworkType() : int{
return ContainerIds::NONE;
}
/**
* Returns the size of the inventory.
* @return int

View File

@ -54,4 +54,10 @@ abstract class ContainerInventory extends BaseInventory{
$who->dataPacket($pk);
parent::onClose($who);
}
/**
* Returns the Minecraft PE inventory type used to show the inventory window to clients.
* @return int
*/
abstract public function getNetworkType() : int;
}

View File

@ -24,8 +24,6 @@ declare(strict_types=1);
namespace pocketmine\inventory;
use pocketmine\network\mcpe\protocol\InventorySlotPacket;
use pocketmine\network\mcpe\protocol\types\ContainerIds;
use pocketmine\network\mcpe\protocol\types\WindowTypes;
use pocketmine\Player;
class PlayerCursorInventory extends BaseInventory{
@ -48,10 +46,6 @@ class PlayerCursorInventory extends BaseInventory{
throw new \BadMethodCallException("Cursor can only carry one item at a time");
}
public function getNetworkType() : int{
return WindowTypes::INVENTORY; //This should never be spawned to clients
}
/**
* This override is here for documentation and code completion purposes only.
* @return Player

View File

@ -35,7 +35,6 @@ 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;
@ -54,10 +53,6 @@ class PlayerInventory extends BaseInventory{
parent::__construct($player);
}
public function getNetworkType() : int{
return WindowTypes::INVENTORY;
}
public function getName() : string{
return "Player";
}