diff --git a/changelogs/4.0-snapshot.md b/changelogs/4.0-snapshot.md index 602f1d501..4299cf210 100644 --- a/changelogs/4.0-snapshot.md +++ b/changelogs/4.0-snapshot.md @@ -434,11 +434,7 @@ This version features substantial changes to the network system, improving coher - `Item::removeCreativeItem()` -> `CreativeInventory::remove()` - The following classes have been added: - `ArmorTypeInfo` - - `Boots` - - `Chestplate` - `Fertilizer` - - `Helmet` - - `Leggings` - `LiquidBucket` - `MilkBucket` - `WritableBookBase` diff --git a/src/item/Armor.php b/src/item/Armor.php index afd880e04..d2b5759ea 100644 --- a/src/item/Armor.php +++ b/src/item/Armor.php @@ -38,7 +38,7 @@ use pocketmine\utils\Color; use function lcg_value; use function mt_rand; -abstract class Armor extends Durable{ +class Armor extends Durable{ public const TAG_CUSTOM_COLOR = "customColor"; //TAG_Int @@ -65,7 +65,9 @@ abstract class Armor extends Durable{ * @see ArmorInventory * @return int */ - abstract public function getArmorSlot() : int; + public function getArmorSlot() : int{ + return $this->armorInfo->getArmorSlot(); + } public function getMaxStackSize() : int{ return 1; diff --git a/src/item/ArmorTypeInfo.php b/src/item/ArmorTypeInfo.php index 9a89a0c5d..172a590b8 100644 --- a/src/item/ArmorTypeInfo.php +++ b/src/item/ArmorTypeInfo.php @@ -29,10 +29,13 @@ class ArmorTypeInfo{ private $defensePoints; /** @var int */ private $maxDurability; + /** @var int */ + private $armorSlot; - public function __construct(int $defensePoints, int $maxDurability){ + public function __construct(int $defensePoints, int $maxDurability, int $armorSlot){ $this->defensePoints = $defensePoints; $this->maxDurability = $maxDurability; + $this->armorSlot = $armorSlot; } /** @@ -48,4 +51,11 @@ class ArmorTypeInfo{ public function getMaxDurability() : int{ return $this->maxDurability; } + + /** + * @return int + */ + public function getArmorSlot() : int{ + return $this->armorSlot; + } } diff --git a/src/item/Boots.php b/src/item/Boots.php deleted file mode 100644 index 13753328d..000000000 --- a/src/item/Boots.php +++ /dev/null @@ -1,33 +0,0 @@ -