mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 12:04:46 +00:00
Merge branch '3.5'
This commit is contained in:
@@ -29,6 +29,8 @@ use pocketmine\network\mcpe\protocol\InventoryContentPacket;
|
||||
use pocketmine\network\mcpe\protocol\InventorySlotPacket;
|
||||
use pocketmine\network\mcpe\protocol\MobArmorEquipmentPacket;
|
||||
use pocketmine\Player;
|
||||
use function array_merge;
|
||||
use function array_search;
|
||||
|
||||
class ArmorInventory extends BaseInventory{
|
||||
public const SLOT_HEAD = 0;
|
||||
|
@@ -33,6 +33,11 @@ use pocketmine\network\mcpe\protocol\InventorySlotPacket;
|
||||
use pocketmine\network\mcpe\protocol\types\ContainerIds;
|
||||
use pocketmine\Player;
|
||||
use pocketmine\utils\Utils;
|
||||
use function array_slice;
|
||||
use function count;
|
||||
use function max;
|
||||
use function min;
|
||||
use function spl_object_hash;
|
||||
|
||||
abstract class BaseInventory implements Inventory{
|
||||
|
||||
|
@@ -28,6 +28,7 @@ use pocketmine\network\mcpe\protocol\LevelSoundEventPacket;
|
||||
use pocketmine\network\mcpe\protocol\types\WindowTypes;
|
||||
use pocketmine\Player;
|
||||
use pocketmine\tile\Chest;
|
||||
use function count;
|
||||
|
||||
class ChestInventory extends ContainerInventory{
|
||||
|
||||
|
@@ -25,6 +25,9 @@ namespace pocketmine\inventory;
|
||||
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\Player;
|
||||
use function max;
|
||||
use function min;
|
||||
use const PHP_INT_MAX;
|
||||
|
||||
class CraftingGrid extends BaseInventory{
|
||||
public const SIZE_SMALL = 2;
|
||||
|
@@ -30,6 +30,12 @@ use pocketmine\network\mcpe\NetworkCompression;
|
||||
use pocketmine\network\mcpe\PacketStream;
|
||||
use pocketmine\network\mcpe\protocol\CraftingDataPacket;
|
||||
use pocketmine\timings\Timings;
|
||||
use function array_map;
|
||||
use function file_get_contents;
|
||||
use function json_decode;
|
||||
use function json_encode;
|
||||
use function usort;
|
||||
use const DIRECTORY_SEPARATOR;
|
||||
|
||||
class CraftingManager{
|
||||
/** @var ShapedRecipe[][] */
|
||||
|
@@ -26,6 +26,9 @@ namespace pocketmine\inventory;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\Player;
|
||||
use pocketmine\tile\Chest;
|
||||
use function array_merge;
|
||||
use function array_slice;
|
||||
use function count;
|
||||
|
||||
class DoubleChestInventory extends ChestInventory implements InventoryHolder{
|
||||
/** @var ChestInventory */
|
||||
|
@@ -29,6 +29,8 @@ use pocketmine\network\mcpe\protocol\InventoryContentPacket;
|
||||
use pocketmine\network\mcpe\protocol\MobEquipmentPacket;
|
||||
use pocketmine\network\mcpe\protocol\types\ContainerIds;
|
||||
use pocketmine\Player;
|
||||
use function in_array;
|
||||
use function is_array;
|
||||
|
||||
class PlayerInventory extends BaseInventory{
|
||||
|
||||
|
@@ -25,6 +25,12 @@ namespace pocketmine\inventory;
|
||||
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\item\ItemFactory;
|
||||
use function array_map;
|
||||
use function array_values;
|
||||
use function count;
|
||||
use function implode;
|
||||
use function strlen;
|
||||
use function strpos;
|
||||
|
||||
class ShapedRecipe implements CraftingRecipe{
|
||||
/** @var string[] */
|
||||
|
@@ -24,6 +24,8 @@ declare(strict_types=1);
|
||||
namespace pocketmine\inventory;
|
||||
|
||||
use pocketmine\item\Item;
|
||||
use function array_map;
|
||||
use function count;
|
||||
|
||||
class ShapelessRecipe implements CraftingRecipe{
|
||||
/** @var Item[] */
|
||||
|
@@ -28,6 +28,9 @@ use pocketmine\inventory\CraftingRecipe;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\network\mcpe\protocol\ContainerClosePacket;
|
||||
use pocketmine\network\mcpe\protocol\types\ContainerIds;
|
||||
use function array_pop;
|
||||
use function count;
|
||||
use function intdiv;
|
||||
|
||||
class CraftingTransaction extends InventoryTransaction{
|
||||
/** @var CraftingRecipe|null */
|
||||
|
@@ -29,6 +29,11 @@ use pocketmine\inventory\transaction\action\InventoryAction;
|
||||
use pocketmine\inventory\transaction\action\SlotChangeAction;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\Player;
|
||||
use function assert;
|
||||
use function count;
|
||||
use function get_class;
|
||||
use function min;
|
||||
use function spl_object_hash;
|
||||
|
||||
/**
|
||||
* This InventoryTransaction only allows doing Transaction between one / two inventories
|
||||
|
@@ -27,6 +27,7 @@ use pocketmine\inventory\Inventory;
|
||||
use pocketmine\inventory\transaction\InventoryTransaction;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\Player;
|
||||
use function spl_object_hash;
|
||||
|
||||
/**
|
||||
* Represents an action causing a change in an inventory slot.
|
||||
|
Reference in New Issue
Block a user