Merge branch '3.5'

This commit is contained in:
Dylan K. Taylor
2019-01-04 23:28:44 +00:00
258 changed files with 1322 additions and 40 deletions

View File

@@ -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;

View File

@@ -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{

View File

@@ -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{

View File

@@ -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;

View File

@@ -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[][] */

View File

@@ -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 */

View File

@@ -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{

View File

@@ -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[] */

View File

@@ -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[] */

View File

@@ -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 */

View File

@@ -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

View File

@@ -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.