From 99622c5ce7dfc9ef8542be7481b641d6938b1191 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 1 Oct 2016 14:48:42 +0100 Subject: [PATCH] Fix wrong network IDs for inventories, fix anvil/enchanting table windows --- src/pocketmine/inventory/InventoryType.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/pocketmine/inventory/InventoryType.php b/src/pocketmine/inventory/InventoryType.php index 85832a6f3..d5fea2604 100644 --- a/src/pocketmine/inventory/InventoryType.php +++ b/src/pocketmine/inventory/InventoryType.php @@ -48,7 +48,7 @@ class InventoryType{ * @return InventoryType */ public static function get($index){ - return isset(static::$default[$index]) ? static::$default[$index] : null; + return static::$default[$index] ?? null; } public static function init(){ @@ -57,15 +57,18 @@ class InventoryType{ } static::$default[static::CHEST] = new InventoryType(27, "Chest", 0); - static::$default[static::DOUBLE_CHEST] = new InventoryType(27 + 27, "DoubleTag Chest", 0); + static::$default[static::DOUBLE_CHEST] = new InventoryType(27 + 27, "Double Chest", 0); static::$default[static::PLAYER] = new InventoryType(36 + 4, "Player", 0); //36 CONTAINER, 4 ARMOR - static::$default[static::FURNACE] = new InventoryType(3, "Furnace", 2); static::$default[static::CRAFTING] = new InventoryType(5, "Crafting", 1); //4 CRAFTING slots, 1 RESULT static::$default[static::WORKBENCH] = new InventoryType(10, "Crafting", 1); //9 CRAFTING slots, 1 RESULT - static::$default[static::STONECUTTER] = new InventoryType(10, "Crafting", 1); //9 CRAFTING slots, 1 RESULT - static::$default[static::ENCHANT_TABLE] = new InventoryType(2, "Enchant", 4); //1 INPUT/OUTPUT, 1 LAPIS - static::$default[static::BREWING_STAND] = new InventoryType(4, "Brewing", 5); //1 INPUT, 3 POTION - static::$default[static::ANVIL] = new InventoryType(3, "Anvil", 6); //2 INPUT, 1 OUTPUT + static::$default[static::FURNACE] = new InventoryType(3, "Furnace", 2); //2 INPUT, 1 OUTPUT + static::$default[static::ENCHANT_TABLE] = new InventoryType(2, "Enchant", 3); //1 INPUT/OUTPUT, 1 LAPIS + static::$default[static::BREWING_STAND] = new InventoryType(4, "Brewing", 4); //1 INPUT, 3 POTION + static::$default[static::ANVIL] = new InventoryType(3, "Anvil", 5); //2 INPUT, 1 OUTPUT + //TODO: add the below + //6: dispenser + //7: dropper + //8: hopper } /**