mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 22:45:28 +00:00
Moved getNetworkType() to ContainerInventory since it's not used anywhere else
This commit is contained in:
parent
1fb6d12a6b
commit
90fb3c5e12
@ -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
|
||||
|
@ -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;
|
||||
}
|
@ -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
|
||||
|
@ -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";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user