mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
armor fix x2(forgot to upload item files
This commit is contained in:
parent
655fa87fb8
commit
5b16046f77
21 changed files with 101 additions and 21 deletions
|
|
@ -239,6 +239,36 @@ class Item{
|
|||
}
|
||||
|
||||
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){
|
||||
return false;
|
||||
}
|
||||
|
|
@ -267,7 +297,57 @@ class Item{
|
|||
}
|
||||
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
|
||||
switch($this->id){
|
||||
case IRON_PICKAXE:
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
class ChainBootsItem extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(CHAIN_BOOTS, 0, $count, "Chain Boots");
|
||||
parent::__construct(CHAIN_BOOTS, $meta, $count, "Chain Boots");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
class ChainChestplateItem extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(CHAIN_CHESTPLATE, 0, $count, "Chain Chestplate");
|
||||
parent::__construct(CHAIN_CHESTPLATE, $meta, $count, "Chain Chestplate");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
class ChainHelmetItem extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(CHAIN_HELMET, 0, $count, "Chain Helmet");
|
||||
parent::__construct(CHAIN_HELMET, $meta, $count, "Chain Helmet");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
class ChainLeggingsItem extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(CHAIN_LEGGINGS, 0, $count, "Chain Leggings");
|
||||
parent::__construct(CHAIN_LEGGINGS, $meta, $count, "Chain Leggings");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
class DiamondBootsItem extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(DIAMOND_BOOTS, 0, $count, "Diamond Boots");
|
||||
parent::__construct(DIAMOND_BOOTS, $meta, $count, "Diamond Boots");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
class DiamondChestplateItem extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(DIAMOND_CHESTPLATE, 0, $count, "Diamond Chestplate");
|
||||
parent::__construct(DIAMOND_CHESTPLATE, $meta, $count, "Diamond Chestplate");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
class DiamondHelmetItem extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(DIAMOND_HELMET, 0, $count, "Diamond Helmet");
|
||||
parent::__construct(DIAMOND_HELMET, $meta, $count, "Diamond Helmet");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
class DiamondLeggingsItem extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(DIAMOND_LEGGINGS, 0, $count, "Diamond Leggings");
|
||||
parent::__construct(DIAMOND_LEGGINGS, $meta, $count, "Diamond Leggings");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
class GoldenBootsItem extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(GOLDEN_BOOTS, 0, $count, "Golden Boots");
|
||||
parent::__construct(GOLDEN_BOOTS, $meta, $count, "Golden Boots");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
class GoldenChestplateItem extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(GOLDEN_CHESTPLATE, 0, $count, "Golden Chestplate");
|
||||
parent::__construct(GOLDEN_CHESTPLATE, $meta, $count, "Golden Chestplate");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
class GoldenHelmetItem extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(GOLDEN_HELMET, 0, $count, "Golden Helmet");
|
||||
parent::__construct(GOLDEN_HELMET, $meta, $count, "Golden Helmet");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
class GoldenLeggingsItem extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(GOLDEN_LEGGINGS, 0, $count, "Golden Leggings");
|
||||
parent::__construct(GOLDEN_LEGGINGS, $meta, $count, "Golden Leggings");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
class IronBootsItem extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(IRON_BOOTS, 0, $count, "Iron Boots");
|
||||
parent::__construct(IRON_BOOTS, $meta, $count, "Iron Boots");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
class IronChestplateItem extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(IRON_CHESTPLATE, 0, $count, "Iron Chestplate");
|
||||
parent::__construct(IRON_CHESTPLATE, $meta, $count, "Iron Chestplate");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
class IronHelmetItem extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(IRON_HELMET, 0, $count, "Iron Helmet");
|
||||
parent::__construct(IRON_HELMET, $meta, $count, "Iron Helmet");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
class IronLeggingsItem extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(IRON_LEGGINGS, 0, $count, "Iron Leggings");
|
||||
parent::__construct(IRON_LEGGINGS, $meta, $count, "Iron Leggings");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
class LeatherBootsItem extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(LEATHER_BOOTS, 0, $count, "Leather Boots");
|
||||
parent::__construct(LEATHER_BOOTS, $meta, $count, "Leather Boots");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
class LeatherCapItem extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(LEATHER_CAP, 0, $count, "Leather Cap");
|
||||
parent::__construct(LEATHER_CAP, $meta, $count, "Leather Cap");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
class LeatherPantsItem extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(LEATHER_PANTS, 0, $count, "Leather Pants");
|
||||
parent::__construct(LEATHER_PANTS, $meta, $count, "Leather Pants");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
class LeatherTunicItem extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(LEATHER_TUNIC, 0, $count, "Leather Tunic");
|
||||
parent::__construct(LEATHER_TUNIC, $meta, $count, "Leather Tunic");
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue