armor fix x2(forgot to upload item files

This commit is contained in:
GameHerobrine 2022-06-02 11:34:25 +03:00
parent 655fa87fb8
commit 5b16046f77
21 changed files with 101 additions and 21 deletions

View file

@ -239,6 +239,36 @@ class Item{
} }
final public function getMaxDurability(){ final public function getMaxDurability(){
$isArmor = $this->isArmor();
if($isArmor !== false){
$armorDurability = [
10 => 56,
11 => 81,
12 => 76,
13 => 66,
20 => 166,
21 => 241,
22 => 226,
23 => 196,
30 => 166,
31 => 241,
32 => 226,
33 => 196,
40 => 364,
41 => 529,
42 => 496,
43 => 430,
50 => 78,
51 => 113,
52 => 106,
53 => 92,
];
return $armorDurability[$isArmor];
}
if(!$this->isTool() and $this->isHoe() === false and $this->id !== BOW){ if(!$this->isTool() and $this->isHoe() === false and $this->id !== BOW){
return false; return false;
} }
@ -267,7 +297,57 @@ class Item{
} }
return $levels[$type]; return $levels[$type];
} }
final public function isArmor(){
switch($this->id){
case LEATHER_CAP:
return 10;
case LEATHER_TUNIC:
return 11;
case LEATHER_PANTS:
return 12;
case LEATHER_BOOTS:
return 13;
case CHAIN_HELMET:
return 20;
case CHAIN_CHESTPLATE:
return 21;
case CHAIN_LEGGINGS:
return 22;
case CHAIN_BOOTS:
return 23;
case IRON_HELMET:
return 30;
case IRON_CHESTPLATE:
return 31;
case IRON_LEGGINGS:
return 32;
case IRON_BOOTS:
return 33;
case DIAMOND_HELMET:
return 40;
case DIAMOND_CHESTPLATE:
return 41;
case DIAMOND_LEGGINGS:
return 42;
case DIAMOND_BOOTS:
return 43;
case GOLD_HELMET:
return 50;
case GOLD_CHESTPLATE:
return 51;
case GOLD_LEGGINGS:
return 52;
case GOLD_BOOTS:
return 53;
default:
return false;
}
}
final public function isPickaxe(){ //Returns false or level of the pickaxe final public function isPickaxe(){ //Returns false or level of the pickaxe
switch($this->id){ switch($this->id){
case IRON_PICKAXE: case IRON_PICKAXE:

View file

@ -21,7 +21,7 @@
class ChainBootsItem extends Item{ class ChainBootsItem extends Item{
public function __construct($meta = 0, $count = 1){ public function __construct($meta = 0, $count = 1){
parent::__construct(CHAIN_BOOTS, 0, $count, "Chain Boots"); parent::__construct(CHAIN_BOOTS, $meta, $count, "Chain Boots");
} }
} }

View file

@ -21,7 +21,7 @@
class ChainChestplateItem extends Item{ class ChainChestplateItem extends Item{
public function __construct($meta = 0, $count = 1){ public function __construct($meta = 0, $count = 1){
parent::__construct(CHAIN_CHESTPLATE, 0, $count, "Chain Chestplate"); parent::__construct(CHAIN_CHESTPLATE, $meta, $count, "Chain Chestplate");
} }
} }

View file

@ -21,7 +21,7 @@
class ChainHelmetItem extends Item{ class ChainHelmetItem extends Item{
public function __construct($meta = 0, $count = 1){ public function __construct($meta = 0, $count = 1){
parent::__construct(CHAIN_HELMET, 0, $count, "Chain Helmet"); parent::__construct(CHAIN_HELMET, $meta, $count, "Chain Helmet");
} }
} }

View file

@ -21,7 +21,7 @@
class ChainLeggingsItem extends Item{ class ChainLeggingsItem extends Item{
public function __construct($meta = 0, $count = 1){ public function __construct($meta = 0, $count = 1){
parent::__construct(CHAIN_LEGGINGS, 0, $count, "Chain Leggings"); parent::__construct(CHAIN_LEGGINGS, $meta, $count, "Chain Leggings");
} }
} }

View file

@ -21,7 +21,7 @@
class DiamondBootsItem extends Item{ class DiamondBootsItem extends Item{
public function __construct($meta = 0, $count = 1){ public function __construct($meta = 0, $count = 1){
parent::__construct(DIAMOND_BOOTS, 0, $count, "Diamond Boots"); parent::__construct(DIAMOND_BOOTS, $meta, $count, "Diamond Boots");
} }
} }

View file

@ -21,7 +21,7 @@
class DiamondChestplateItem extends Item{ class DiamondChestplateItem extends Item{
public function __construct($meta = 0, $count = 1){ public function __construct($meta = 0, $count = 1){
parent::__construct(DIAMOND_CHESTPLATE, 0, $count, "Diamond Chestplate"); parent::__construct(DIAMOND_CHESTPLATE, $meta, $count, "Diamond Chestplate");
} }
} }

View file

@ -21,7 +21,7 @@
class DiamondHelmetItem extends Item{ class DiamondHelmetItem extends Item{
public function __construct($meta = 0, $count = 1){ public function __construct($meta = 0, $count = 1){
parent::__construct(DIAMOND_HELMET, 0, $count, "Diamond Helmet"); parent::__construct(DIAMOND_HELMET, $meta, $count, "Diamond Helmet");
} }
} }

View file

@ -21,7 +21,7 @@
class DiamondLeggingsItem extends Item{ class DiamondLeggingsItem extends Item{
public function __construct($meta = 0, $count = 1){ public function __construct($meta = 0, $count = 1){
parent::__construct(DIAMOND_LEGGINGS, 0, $count, "Diamond Leggings"); parent::__construct(DIAMOND_LEGGINGS, $meta, $count, "Diamond Leggings");
} }
} }

View file

@ -21,7 +21,7 @@
class GoldenBootsItem extends Item{ class GoldenBootsItem extends Item{
public function __construct($meta = 0, $count = 1){ public function __construct($meta = 0, $count = 1){
parent::__construct(GOLDEN_BOOTS, 0, $count, "Golden Boots"); parent::__construct(GOLDEN_BOOTS, $meta, $count, "Golden Boots");
} }
} }

View file

@ -21,7 +21,7 @@
class GoldenChestplateItem extends Item{ class GoldenChestplateItem extends Item{
public function __construct($meta = 0, $count = 1){ public function __construct($meta = 0, $count = 1){
parent::__construct(GOLDEN_CHESTPLATE, 0, $count, "Golden Chestplate"); parent::__construct(GOLDEN_CHESTPLATE, $meta, $count, "Golden Chestplate");
} }
} }

View file

@ -21,7 +21,7 @@
class GoldenHelmetItem extends Item{ class GoldenHelmetItem extends Item{
public function __construct($meta = 0, $count = 1){ public function __construct($meta = 0, $count = 1){
parent::__construct(GOLDEN_HELMET, 0, $count, "Golden Helmet"); parent::__construct(GOLDEN_HELMET, $meta, $count, "Golden Helmet");
} }
} }

View file

@ -21,7 +21,7 @@
class GoldenLeggingsItem extends Item{ class GoldenLeggingsItem extends Item{
public function __construct($meta = 0, $count = 1){ public function __construct($meta = 0, $count = 1){
parent::__construct(GOLDEN_LEGGINGS, 0, $count, "Golden Leggings"); parent::__construct(GOLDEN_LEGGINGS, $meta, $count, "Golden Leggings");
} }
} }

View file

@ -21,7 +21,7 @@
class IronBootsItem extends Item{ class IronBootsItem extends Item{
public function __construct($meta = 0, $count = 1){ public function __construct($meta = 0, $count = 1){
parent::__construct(IRON_BOOTS, 0, $count, "Iron Boots"); parent::__construct(IRON_BOOTS, $meta, $count, "Iron Boots");
} }
} }

View file

@ -21,7 +21,7 @@
class IronChestplateItem extends Item{ class IronChestplateItem extends Item{
public function __construct($meta = 0, $count = 1){ public function __construct($meta = 0, $count = 1){
parent::__construct(IRON_CHESTPLATE, 0, $count, "Iron Chestplate"); parent::__construct(IRON_CHESTPLATE, $meta, $count, "Iron Chestplate");
} }
} }

View file

@ -21,7 +21,7 @@
class IronHelmetItem extends Item{ class IronHelmetItem extends Item{
public function __construct($meta = 0, $count = 1){ public function __construct($meta = 0, $count = 1){
parent::__construct(IRON_HELMET, 0, $count, "Iron Helmet"); parent::__construct(IRON_HELMET, $meta, $count, "Iron Helmet");
} }
} }

View file

@ -21,7 +21,7 @@
class IronLeggingsItem extends Item{ class IronLeggingsItem extends Item{
public function __construct($meta = 0, $count = 1){ public function __construct($meta = 0, $count = 1){
parent::__construct(IRON_LEGGINGS, 0, $count, "Iron Leggings"); parent::__construct(IRON_LEGGINGS, $meta, $count, "Iron Leggings");
} }
} }

View file

@ -21,7 +21,7 @@
class LeatherBootsItem extends Item{ class LeatherBootsItem extends Item{
public function __construct($meta = 0, $count = 1){ public function __construct($meta = 0, $count = 1){
parent::__construct(LEATHER_BOOTS, 0, $count, "Leather Boots"); parent::__construct(LEATHER_BOOTS, $meta, $count, "Leather Boots");
} }
} }

View file

@ -21,7 +21,7 @@
class LeatherCapItem extends Item{ class LeatherCapItem extends Item{
public function __construct($meta = 0, $count = 1){ public function __construct($meta = 0, $count = 1){
parent::__construct(LEATHER_CAP, 0, $count, "Leather Cap"); parent::__construct(LEATHER_CAP, $meta, $count, "Leather Cap");
} }
} }

View file

@ -21,7 +21,7 @@
class LeatherPantsItem extends Item{ class LeatherPantsItem extends Item{
public function __construct($meta = 0, $count = 1){ public function __construct($meta = 0, $count = 1){
parent::__construct(LEATHER_PANTS, 0, $count, "Leather Pants"); parent::__construct(LEATHER_PANTS, $meta, $count, "Leather Pants");
} }
} }

View file

@ -21,7 +21,7 @@
class LeatherTunicItem extends Item{ class LeatherTunicItem extends Item{
public function __construct($meta = 0, $count = 1){ public function __construct($meta = 0, $count = 1){
parent::__construct(LEATHER_TUNIC, 0, $count, "Leather Tunic"); parent::__construct(LEATHER_TUNIC, $meta, $count, "Leather Tunic");
} }
} }