mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-08-30 23:11:06 +00:00
Clean up Armor classes
This commit is contained in:
parent
2e4b3d3d46
commit
8b9eeb0b7f
@ -25,6 +25,7 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
use pocketmine\event\entity\EntityDamageEvent;
|
use pocketmine\event\entity\EntityDamageEvent;
|
||||||
|
use pocketmine\inventory\ArmorInventory;
|
||||||
use pocketmine\item\enchantment\Enchantment;
|
use pocketmine\item\enchantment\Enchantment;
|
||||||
use pocketmine\item\enchantment\ProtectionEnchantment;
|
use pocketmine\item\enchantment\ProtectionEnchantment;
|
||||||
use pocketmine\nbt\tag\IntTag;
|
use pocketmine\nbt\tag\IntTag;
|
||||||
@ -37,6 +38,28 @@ abstract class Armor extends Durable{
|
|||||||
|
|
||||||
public const TAG_CUSTOM_COLOR = "customColor"; //TAG_Int
|
public const TAG_CUSTOM_COLOR = "customColor"; //TAG_Int
|
||||||
|
|
||||||
|
/** @var ArmorTypeInfo */
|
||||||
|
private $armorInfo;
|
||||||
|
|
||||||
|
public function __construct(int $id, int $variant, string $name, ArmorTypeInfo $info){
|
||||||
|
parent::__construct($id, $variant, $name);
|
||||||
|
$this->armorInfo = $info;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMaxDurability() : int{
|
||||||
|
return $this->armorInfo->getMaxDurability();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDefensePoints() : int{
|
||||||
|
return $this->armorInfo->getDefensePoints();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see ArmorInventory
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
abstract public function getArmorSlot() : int;
|
||||||
|
|
||||||
public function getMaxStackSize() : int{
|
public function getMaxStackSize() : int{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -23,17 +23,29 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
|
class ArmorTypeInfo{
|
||||||
|
|
||||||
class ChainBoots extends Armor{
|
/** @var int */
|
||||||
public function __construct(){
|
private $defensePoints;
|
||||||
parent::__construct(self::CHAIN_BOOTS, 0, "Chainmail Boots");
|
/** @var int */
|
||||||
|
private $maxDurability;
|
||||||
|
|
||||||
|
public function __construct(int $defensePoints, int $maxDurability){
|
||||||
|
$this->defensePoints = $defensePoints;
|
||||||
|
$this->maxDurability = $maxDurability;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
public function getDefensePoints() : int{
|
public function getDefensePoints() : int{
|
||||||
return 1;
|
return $this->defensePoints;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
public function getMaxDurability() : int{
|
public function getMaxDurability() : int{
|
||||||
return 196;
|
return $this->maxDurability;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -23,17 +23,11 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
|
use pocketmine\inventory\ArmorInventory;
|
||||||
|
|
||||||
class GoldBoots extends Armor{
|
class Boots extends Armor{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::GOLD_BOOTS, 0, "Gold Boots");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDefensePoints() : int{
|
public function getArmorSlot() : int{
|
||||||
return 1;
|
return ArmorInventory::SLOT_FEET;
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxDurability() : int{
|
|
||||||
return 92;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,39 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* @author PocketMine Team
|
|
||||||
* @link http://www.pocketmine.net/
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace pocketmine\item;
|
|
||||||
|
|
||||||
|
|
||||||
class ChainChestplate extends Armor{
|
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::CHAIN_CHESTPLATE, 0, "Chain Chestplate");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDefensePoints() : int{
|
|
||||||
return 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxDurability() : int{
|
|
||||||
return 241;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,39 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* @author PocketMine Team
|
|
||||||
* @link http://www.pocketmine.net/
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace pocketmine\item;
|
|
||||||
|
|
||||||
|
|
||||||
class ChainHelmet extends Armor{
|
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::CHAIN_HELMET, 0, "Chainmail Helmet");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDefensePoints() : int{
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxDurability() : int{
|
|
||||||
return 166;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,39 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* @author PocketMine Team
|
|
||||||
* @link http://www.pocketmine.net/
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace pocketmine\item;
|
|
||||||
|
|
||||||
|
|
||||||
class ChainLeggings extends Armor{
|
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::CHAIN_LEGGINGS, 0, "Chain Leggings");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDefensePoints() : int{
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxDurability() : int{
|
|
||||||
return 226;
|
|
||||||
}
|
|
||||||
}
|
|
@ -23,17 +23,11 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
|
use pocketmine\inventory\ArmorInventory;
|
||||||
|
|
||||||
class IronBoots extends Armor{
|
class Chestplate extends Armor{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::IRON_BOOTS, 0, "Iron Boots");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDefensePoints() : int{
|
public function getArmorSlot() : int{
|
||||||
return 2;
|
return ArmorInventory::SLOT_CHEST;
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxDurability() : int{
|
|
||||||
return 196;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,39 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* @author PocketMine Team
|
|
||||||
* @link http://www.pocketmine.net/
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace pocketmine\item;
|
|
||||||
|
|
||||||
|
|
||||||
class DiamondBoots extends Armor{
|
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::DIAMOND_BOOTS, 0, "Diamond Boots");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDefensePoints() : int{
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxDurability() : int{
|
|
||||||
return 430;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,39 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* @author PocketMine Team
|
|
||||||
* @link http://www.pocketmine.net/
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace pocketmine\item;
|
|
||||||
|
|
||||||
|
|
||||||
class DiamondChestplate extends Armor{
|
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::DIAMOND_CHESTPLATE, 0, "Diamond Chestplate");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDefensePoints() : int{
|
|
||||||
return 8;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxDurability() : int{
|
|
||||||
return 529;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,39 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* @author PocketMine Team
|
|
||||||
* @link http://www.pocketmine.net/
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace pocketmine\item;
|
|
||||||
|
|
||||||
|
|
||||||
class DiamondHelmet extends Armor{
|
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::DIAMOND_HELMET, 0, "Diamond Helmet");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDefensePoints() : int{
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxDurability() : int{
|
|
||||||
return 364;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,39 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* @author PocketMine Team
|
|
||||||
* @link http://www.pocketmine.net/
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace pocketmine\item;
|
|
||||||
|
|
||||||
|
|
||||||
class DiamondLeggings extends Armor{
|
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::DIAMOND_LEGGINGS, 0, "Diamond Leggings");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDefensePoints() : int{
|
|
||||||
return 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxDurability() : int{
|
|
||||||
return 496;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,39 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* @author PocketMine Team
|
|
||||||
* @link http://www.pocketmine.net/
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace pocketmine\item;
|
|
||||||
|
|
||||||
|
|
||||||
class GoldChestplate extends Armor{
|
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::GOLD_CHESTPLATE, 0, "Gold Chestplate");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDefensePoints() : int{
|
|
||||||
return 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxDurability() : int{
|
|
||||||
return 113;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,39 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* @author PocketMine Team
|
|
||||||
* @link http://www.pocketmine.net/
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace pocketmine\item;
|
|
||||||
|
|
||||||
|
|
||||||
class GoldLeggings extends Armor{
|
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::GOLD_LEGGINGS, 0, "Gold Leggings");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDefensePoints() : int{
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxDurability() : int{
|
|
||||||
return 106;
|
|
||||||
}
|
|
||||||
}
|
|
@ -23,17 +23,11 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
|
use pocketmine\inventory\ArmorInventory;
|
||||||
|
|
||||||
class LeatherCap extends Armor{
|
class Helmet extends Armor{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::LEATHER_CAP, 0, "Leather Cap");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDefensePoints() : int{
|
public function getArmorSlot() : int{
|
||||||
return 1;
|
return ArmorInventory::SLOT_HEAD;
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxDurability() : int{
|
|
||||||
return 56;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,39 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* @author PocketMine Team
|
|
||||||
* @link http://www.pocketmine.net/
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace pocketmine\item;
|
|
||||||
|
|
||||||
|
|
||||||
class IronChestplate extends Armor{
|
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::IRON_CHESTPLATE, 0, "Iron Chestplate");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDefensePoints() : int{
|
|
||||||
return 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxDurability() : int{
|
|
||||||
return 241;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,39 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* @author PocketMine Team
|
|
||||||
* @link http://www.pocketmine.net/
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace pocketmine\item;
|
|
||||||
|
|
||||||
|
|
||||||
class IronHelmet extends Armor{
|
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::IRON_HELMET, 0, "Iron Helmet");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDefensePoints() : int{
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxDurability() : int{
|
|
||||||
return 166;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,39 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* @author PocketMine Team
|
|
||||||
* @link http://www.pocketmine.net/
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace pocketmine\item;
|
|
||||||
|
|
||||||
|
|
||||||
class IronLeggings extends Armor{
|
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::IRON_LEGGINGS, 0, "Iron Leggings");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDefensePoints() : int{
|
|
||||||
return 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxDurability() : int{
|
|
||||||
return 226;
|
|
||||||
}
|
|
||||||
}
|
|
@ -67,15 +67,21 @@ class ItemFactory{
|
|||||||
self::register(new BlazeRod());
|
self::register(new BlazeRod());
|
||||||
self::register(new Boat());
|
self::register(new Boat());
|
||||||
self::register(new Book());
|
self::register(new Book());
|
||||||
|
self::register(new Boots(Item::CHAIN_BOOTS, 0, "Chainmail Boots", new ArmorTypeInfo(1, 196)));
|
||||||
|
self::register(new Boots(Item::DIAMOND_BOOTS, 0, "Diamond Boots", new ArmorTypeInfo(3, 430)));
|
||||||
|
self::register(new Boots(Item::GOLDEN_BOOTS, 0, "Gold Boots", new ArmorTypeInfo(1, 92)));
|
||||||
|
self::register(new Boots(Item::IRON_BOOTS, 0, "Iron Boots", new ArmorTypeInfo(2, 196)));
|
||||||
|
self::register(new Boots(Item::LEATHER_BOOTS, 0, "Leather Boots", new ArmorTypeInfo(1, 66)));
|
||||||
self::register(new Bow());
|
self::register(new Bow());
|
||||||
self::register(new Bowl());
|
self::register(new Bowl());
|
||||||
self::register(new Bread());
|
self::register(new Bread());
|
||||||
self::register(new Bucket(Item::BUCKET, 0, "Bucket"));
|
self::register(new Bucket(Item::BUCKET, 0, "Bucket"));
|
||||||
self::register(new Carrot());
|
self::register(new Carrot());
|
||||||
self::register(new ChainBoots());
|
self::register(new Chestplate(Item::CHAIN_CHESTPLATE, 0, "Chainmail Chestplate", new ArmorTypeInfo(5, 241)));
|
||||||
self::register(new ChainChestplate());
|
self::register(new Chestplate(Item::DIAMOND_CHESTPLATE, 0, "Diamond Chestplate", new ArmorTypeInfo(8, 529)));
|
||||||
self::register(new ChainHelmet());
|
self::register(new Chestplate(Item::GOLDEN_CHESTPLATE, 0, "Gold Chestplate", new ArmorTypeInfo(5, 113)));
|
||||||
self::register(new ChainLeggings());
|
self::register(new Chestplate(Item::IRON_CHESTPLATE, 0, "Iron Chestplate", new ArmorTypeInfo(6, 241)));
|
||||||
|
self::register(new Chestplate(Item::LEATHER_CHESTPLATE, 0, "Leather Tunic", new ArmorTypeInfo(3, 81)));
|
||||||
self::register(new ChorusFruit());
|
self::register(new ChorusFruit());
|
||||||
self::register(new Clock());
|
self::register(new Clock());
|
||||||
self::register(new Clownfish());
|
self::register(new Clownfish());
|
||||||
@ -90,10 +96,6 @@ class ItemFactory{
|
|||||||
self::register(new CookedRabbit());
|
self::register(new CookedRabbit());
|
||||||
self::register(new CookedSalmon());
|
self::register(new CookedSalmon());
|
||||||
self::register(new Cookie());
|
self::register(new Cookie());
|
||||||
self::register(new DiamondBoots());
|
|
||||||
self::register(new DiamondChestplate());
|
|
||||||
self::register(new DiamondHelmet());
|
|
||||||
self::register(new DiamondLeggings());
|
|
||||||
self::register(new DriedKelp());
|
self::register(new DriedKelp());
|
||||||
self::register(new Egg());
|
self::register(new Egg());
|
||||||
self::register(new EnderPearl());
|
self::register(new EnderPearl());
|
||||||
@ -102,22 +104,19 @@ class ItemFactory{
|
|||||||
self::register(new FishingRod());
|
self::register(new FishingRod());
|
||||||
self::register(new FlintSteel());
|
self::register(new FlintSteel());
|
||||||
self::register(new GlassBottle());
|
self::register(new GlassBottle());
|
||||||
self::register(new GoldBoots());
|
|
||||||
self::register(new GoldChestplate());
|
|
||||||
self::register(new GoldHelmet());
|
|
||||||
self::register(new GoldLeggings());
|
|
||||||
self::register(new GoldenApple());
|
self::register(new GoldenApple());
|
||||||
self::register(new GoldenAppleEnchanted());
|
self::register(new GoldenAppleEnchanted());
|
||||||
self::register(new GoldenCarrot());
|
self::register(new GoldenCarrot());
|
||||||
|
self::register(new Helmet(Item::CHAIN_HELMET, 0, "Chainmail Helmet", new ArmorTypeInfo(2, 166)));
|
||||||
|
self::register(new Helmet(Item::DIAMOND_HELMET, 0, "Diamond Helmet", new ArmorTypeInfo(3, 364)));
|
||||||
|
self::register(new Helmet(Item::GOLDEN_HELMET, 0, "Gold Helmet", new ArmorTypeInfo(2, 78)));
|
||||||
|
self::register(new Helmet(Item::IRON_HELMET, 0, "Iron Helmet", new ArmorTypeInfo(2, 166)));
|
||||||
|
self::register(new Helmet(Item::LEATHER_HELMET, 0, "Leather Cap", new ArmorTypeInfo(1, 56)));
|
||||||
self::register(new Hoe(Item::DIAMOND_HOE, "Diamond Hoe", TieredTool::TIER_DIAMOND));
|
self::register(new Hoe(Item::DIAMOND_HOE, "Diamond Hoe", TieredTool::TIER_DIAMOND));
|
||||||
self::register(new Hoe(Item::GOLDEN_HOE, "Golden Hoe", TieredTool::TIER_GOLD));
|
self::register(new Hoe(Item::GOLDEN_HOE, "Golden Hoe", TieredTool::TIER_GOLD));
|
||||||
self::register(new Hoe(Item::IRON_HOE, "Iron Hoe", TieredTool::TIER_IRON));
|
self::register(new Hoe(Item::IRON_HOE, "Iron Hoe", TieredTool::TIER_IRON));
|
||||||
self::register(new Hoe(Item::STONE_HOE, "Stone Hoe", TieredTool::TIER_STONE));
|
self::register(new Hoe(Item::STONE_HOE, "Stone Hoe", TieredTool::TIER_STONE));
|
||||||
self::register(new Hoe(Item::WOODEN_HOE, "Wooden Hoe", TieredTool::TIER_WOODEN));
|
self::register(new Hoe(Item::WOODEN_HOE, "Wooden Hoe", TieredTool::TIER_WOODEN));
|
||||||
self::register(new IronBoots());
|
|
||||||
self::register(new IronChestplate());
|
|
||||||
self::register(new IronHelmet());
|
|
||||||
self::register(new IronLeggings());
|
|
||||||
self::register(new Item(Item::BLAZE_POWDER, 0, "Blaze Powder"));
|
self::register(new Item(Item::BLAZE_POWDER, 0, "Blaze Powder"));
|
||||||
self::register(new Item(Item::BLEACH, 0, "Bleach")); //EDU
|
self::register(new Item(Item::BLEACH, 0, "Bleach")); //EDU
|
||||||
self::register(new Item(Item::BONE, 0, "Bone"));
|
self::register(new Item(Item::BONE, 0, "Bone"));
|
||||||
@ -174,14 +173,15 @@ class ItemFactory{
|
|||||||
self::register(new ItemBlock(Block::REPEATER_BLOCK, 0, Item::REPEATER));
|
self::register(new ItemBlock(Block::REPEATER_BLOCK, 0, Item::REPEATER));
|
||||||
self::register(new ItemBlock(Block::SPRUCE_DOOR_BLOCK, 0, Item::SPRUCE_DOOR));
|
self::register(new ItemBlock(Block::SPRUCE_DOOR_BLOCK, 0, Item::SPRUCE_DOOR));
|
||||||
self::register(new ItemBlock(Block::SUGARCANE_BLOCK, 0, Item::SUGARCANE));
|
self::register(new ItemBlock(Block::SUGARCANE_BLOCK, 0, Item::SUGARCANE));
|
||||||
self::register(new LeatherBoots());
|
self::register(new Leggings(Item::CHAIN_LEGGINGS, 0, "Chainmail Leggings", new ArmorTypeInfo(4, 226)));
|
||||||
self::register(new LeatherCap());
|
self::register(new Leggings(Item::DIAMOND_LEGGINGS, 0, "Diamond Leggings", new ArmorTypeInfo(6, 496)));
|
||||||
self::register(new LeatherPants());
|
self::register(new Leggings(Item::GOLDEN_LEGGINGS, 0, "Gold Leggings", new ArmorTypeInfo(3, 106)));
|
||||||
self::register(new LeatherTunic());
|
self::register(new Leggings(Item::IRON_LEGGINGS, 0, "Iron Leggings", new ArmorTypeInfo(5, 226)));
|
||||||
|
self::register(new Leggings(Item::LEATHER_LEGGINGS, 0, "Leather Pants", new ArmorTypeInfo(2, 76)));
|
||||||
//TODO: fix metadata for buckets with still liquid in them
|
//TODO: fix metadata for buckets with still liquid in them
|
||||||
//the meta values are intentionally hardcoded because block IDs will change in the future
|
//the meta values are intentionally hardcoded because block IDs will change in the future
|
||||||
self::register(new LiquidBucket(Item::BUCKET, 10, "Lava Bucket", Block::FLOWING_LAVA));
|
|
||||||
self::register(new LiquidBucket(Item::BUCKET, 8, "Water Bucket", Block::FLOWING_WATER));
|
self::register(new LiquidBucket(Item::BUCKET, 8, "Water Bucket", Block::FLOWING_WATER));
|
||||||
|
self::register(new LiquidBucket(Item::BUCKET, 10, "Lava Bucket", Block::FLOWING_LAVA));
|
||||||
self::register(new Melon());
|
self::register(new Melon());
|
||||||
self::register(new MelonSeeds());
|
self::register(new MelonSeeds());
|
||||||
self::register(new MilkBucket(Item::BUCKET, 1, "Milk Bucket"));
|
self::register(new MilkBucket(Item::BUCKET, 1, "Milk Bucket"));
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* @author PocketMine Team
|
|
||||||
* @link http://www.pocketmine.net/
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace pocketmine\item;
|
|
||||||
|
|
||||||
|
|
||||||
class LeatherBoots extends Armor{
|
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::LEATHER_BOOTS, 0, "Leather Boots");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDefensePoints() : int{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxDurability() : int{
|
|
||||||
return 66;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,39 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* @author PocketMine Team
|
|
||||||
* @link http://www.pocketmine.net/
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace pocketmine\item;
|
|
||||||
|
|
||||||
|
|
||||||
class LeatherPants extends Armor{
|
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::LEATHER_PANTS, 0, "Leather Pants");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDefensePoints() : int{
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxDurability() : int{
|
|
||||||
return 76;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,39 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* ____ _ _ __ __ _ __ __ ____
|
|
||||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
|
||||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
|
||||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
|
||||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* @author PocketMine Team
|
|
||||||
* @link http://www.pocketmine.net/
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace pocketmine\item;
|
|
||||||
|
|
||||||
|
|
||||||
class LeatherTunic extends Armor{
|
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::LEATHER_TUNIC, 0, "Leather Tunic");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDefensePoints() : int{
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxDurability() : int{
|
|
||||||
return 81;
|
|
||||||
}
|
|
||||||
}
|
|
@ -23,17 +23,11 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
|
use pocketmine\inventory\ArmorInventory;
|
||||||
|
|
||||||
class GoldHelmet extends Armor{
|
class Leggings extends Armor{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::GOLD_HELMET, 0, "Gold Helmet");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDefensePoints() : int{
|
public function getArmorSlot() : int{
|
||||||
return 2;
|
return ArmorInventory::SLOT_LEGS;
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxDurability() : int{
|
|
||||||
return 78;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user