mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 21:19:44 +00:00
small changes to armor system + maxstacksize of armor is fixed
This commit is contained in:
parent
39f0b29115
commit
f2da48c7e3
48 changed files with 312 additions and 136 deletions
|
|
@ -1,6 +1,12 @@
|
||||||
`<?php
|
<?php
|
||||||
|
|
||||||
class Item{
|
class Item{
|
||||||
|
const TOOL_SWORD = 0;
|
||||||
|
const TOOL_PICKAXE = 1;
|
||||||
|
const TOOL_AXE = 2;
|
||||||
|
const TOOL_SHOVEL = 3;
|
||||||
|
const TOOL_HOE = 4;
|
||||||
|
|
||||||
public static $class = array(
|
public static $class = array(
|
||||||
|
|
||||||
//armor
|
//armor
|
||||||
|
|
@ -139,20 +145,20 @@ class Item{
|
||||||
$this->block = BlockAPI::get($this->id, $this->meta);
|
$this->block = BlockAPI::get($this->id, $this->meta);
|
||||||
$this->name = $this->block->getName();
|
$this->name = $this->block->getName();
|
||||||
}
|
}
|
||||||
if($this->isTool() !== false){
|
if($this->isTool() || $this->isArmor()){
|
||||||
$this->maxStackSize = 1;
|
$this->maxStackSize = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getName(){
|
public function getName(){
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function isPlaceable(){
|
public function isPlaceable(){
|
||||||
return (($this->block instanceof Block) and $this->block->isPlaceable === true);
|
return (($this->block instanceof Block) and $this->block->isPlaceable === true);
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getBlock(){
|
public function getBlock(){
|
||||||
if($this->block instanceof Block){
|
if($this->block instanceof Block){
|
||||||
return $this->block;
|
return $this->block;
|
||||||
}else{
|
}else{
|
||||||
|
|
@ -160,19 +166,23 @@ class Item{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getID(){
|
public function getID(){
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getMetadata(){
|
public function getMetadata(){
|
||||||
return $this->meta;
|
return $this->meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getMaxStackSize(){
|
public function isArmor(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMaxStackSize(){
|
||||||
return $this->maxStackSize;
|
return $this->maxStackSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getFuelTime(){
|
public function getFuelTime(){
|
||||||
if(!isset(FuelData::$duration[$this->id])){
|
if(!isset(FuelData::$duration[$this->id])){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -182,7 +192,7 @@ class Item{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getSmeltItem(){
|
public function getSmeltItem(){
|
||||||
if(!isset(SmeltingData::$product[$this->id])){
|
if(!isset(SmeltingData::$product[$this->id])){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -199,7 +209,7 @@ class Item{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function useOn($object, $force = false){
|
public function useOn($object, $force = false){ //move shearing & milking code here?
|
||||||
if($this->isTool() or $force === true){
|
if($this->isTool() or $force === true){
|
||||||
if(($object instanceof Entity) and !$this->isSword()){
|
if(($object instanceof Entity) and !$this->isSword()){
|
||||||
$this->meta += 2;
|
$this->meta += 2;
|
||||||
|
|
@ -215,15 +225,11 @@ class Item{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function isTool(){
|
public function isTool(){
|
||||||
return ($this->id === FLINT_STEEL or $this->id === SHEARS or $this->isPickaxe() !== false or $this->isAxe() !== false or $this->isShovel() !== false or $this->isSword() !== false);
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function getMaxDurability(){
|
public function getMaxDurability(){
|
||||||
$isArmor = $this->getArmorMaterialDurability(); //can be used any of new methods, both return false if item is not armor
|
|
||||||
if($isArmor !== false){
|
|
||||||
return $this->getArmorMaterialDurability() * $this->getHealthPerArmorSlot();
|
|
||||||
}
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
@ -234,9 +240,9 @@ class Item{
|
||||||
3 => 131, //STONE
|
3 => 131, //STONE
|
||||||
4 => 250, //IRON
|
4 => 250, //IRON
|
||||||
5 => 1561, //DIAMOND(called EMERALD in disassembled code)
|
5 => 1561, //DIAMOND(called EMERALD in disassembled code)
|
||||||
FLINT_STEEL => 65,
|
FLINT_STEEL => 65, //lets assume it is correct
|
||||||
SHEARS => 239,
|
SHEARS => 239, //x2
|
||||||
BOW => 385,
|
BOW => 385 //x3
|
||||||
);
|
);
|
||||||
|
|
||||||
if(($type = $this->isPickaxe()) === false){
|
if(($type = $this->isPickaxe()) === false){
|
||||||
|
|
@ -253,74 +259,7 @@ class Item{
|
||||||
return $levels[$type];
|
return $levels[$type];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getArmorMaterialDurability(){
|
public function isPickaxe(){ //Returns false or level of the pickaxe
|
||||||
switch($this->id){
|
|
||||||
case LEATHER_CAP:
|
|
||||||
case LEATHER_TUNIC:
|
|
||||||
case LEATHER_PANTS:
|
|
||||||
case LEATHER_BOOTS:
|
|
||||||
return 5;
|
|
||||||
|
|
||||||
case CHAIN_HELMET:
|
|
||||||
case CHAIN_CHESTPLATE:
|
|
||||||
case CHAIN_LEGGINGS:
|
|
||||||
case CHAIN_BOOTS:
|
|
||||||
return 15;
|
|
||||||
|
|
||||||
case IRON_HELMET:
|
|
||||||
case IRON_CHESTPLATE:
|
|
||||||
case IRON_LEGGINGS:
|
|
||||||
case IRON_BOOTS:
|
|
||||||
return 15;
|
|
||||||
|
|
||||||
case DIAMOND_HELMET:
|
|
||||||
case DIAMOND_CHESTPLATE:
|
|
||||||
case DIAMOND_LEGGINGS:
|
|
||||||
case DIAMOND_BOOTS:
|
|
||||||
return 33;
|
|
||||||
|
|
||||||
case GOLD_HELMET:
|
|
||||||
case GOLD_CHESTPLATE:
|
|
||||||
case GOLD_LEGGINGS:
|
|
||||||
case GOLD_BOOTS:
|
|
||||||
return 7;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getHealthPerArmorSlot(){
|
|
||||||
switch($this->id){
|
|
||||||
case LEATHER_CAP:
|
|
||||||
case CHAIN_HELMET:
|
|
||||||
case IRON_HELMET:
|
|
||||||
case DIAMOND_HELMET:
|
|
||||||
case GOLD_HELMET:
|
|
||||||
return 11;
|
|
||||||
case LEATHER_TUNIC:
|
|
||||||
case CHAIN_CHESTPLATE:
|
|
||||||
case IRON_CHESTPLATE:
|
|
||||||
case DIAMOND_CHESTPLATE:
|
|
||||||
case GOLD_CHESTPLATE:
|
|
||||||
return 16;
|
|
||||||
case LEATHER_PANTS:
|
|
||||||
case CHAIN_LEGGINGS:
|
|
||||||
case IRON_LEGGINGS:
|
|
||||||
case DIAMOND_LEGGINGS:
|
|
||||||
case GOLD_LEGGINGS:
|
|
||||||
return 15;
|
|
||||||
case LEATHER_BOOTS:
|
|
||||||
case CHAIN_BOOTS:
|
|
||||||
case IRON_BOOTS:
|
|
||||||
case DIAMOND_BOOTS:
|
|
||||||
case GOLD_BOOTS:
|
|
||||||
return 13;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
final public function isPickaxe(){ //Returns false or level of the pickaxe
|
|
||||||
switch($this->id){
|
switch($this->id){
|
||||||
case IRON_PICKAXE:
|
case IRON_PICKAXE:
|
||||||
return 4;
|
return 4;
|
||||||
|
|
@ -337,7 +276,7 @@ class Item{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function isAxe(){
|
public function isAxe(){
|
||||||
switch($this->id){
|
switch($this->id){
|
||||||
case IRON_AXE:
|
case IRON_AXE:
|
||||||
return 4;
|
return 4;
|
||||||
|
|
@ -354,7 +293,7 @@ class Item{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function isSword(){
|
public function isSword(){
|
||||||
switch($this->id){
|
switch($this->id){
|
||||||
case IRON_SWORD:
|
case IRON_SWORD:
|
||||||
return 4;
|
return 4;
|
||||||
|
|
@ -371,7 +310,7 @@ class Item{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function isShovel(){
|
public function isShovel(){
|
||||||
switch($this->id){
|
switch($this->id){
|
||||||
case IRON_SHOVEL:
|
case IRON_SHOVEL:
|
||||||
return 4;
|
return 4;
|
||||||
|
|
@ -405,7 +344,7 @@ class Item{
|
||||||
return ($this->id === SHEARS);
|
return ($this->id === SHEARS);
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function __toString(){
|
public function __toString(){
|
||||||
return "Item ". $this->name ." (".$this->id.":".$this->meta.")";
|
return "Item ". $this->name ." (".$this->id.":".$this->meta.")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,17 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class ChainBootsItem extends Item{
|
class ChainBootsItem extends ArmorItem{
|
||||||
|
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(CHAIN_BOOTS, $meta, $count, "Chain Boots");
|
parent::__construct(CHAIN_BOOTS, $meta, $count, "Chain Boots");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMaterialDurability(){
|
||||||
|
return Material::CHAIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBaseDurability(){
|
||||||
|
return 13;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class ChainChestplateItem extends Item{
|
class ChainChestplateItem extends ArmorItem{
|
||||||
|
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(CHAIN_CHESTPLATE, $meta, $count, "Chain Chestplate");
|
parent::__construct(CHAIN_CHESTPLATE, $meta, $count, "Chain Chestplate");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMaterialDurability(){
|
||||||
|
return Material::CHAIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBaseDurability(){
|
||||||
|
return 16;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class ChainHelmetItem extends Item{
|
class ChainHelmetItem extends ArmorItem{
|
||||||
|
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(CHAIN_HELMET, $meta, $count, "Chain Helmet");
|
parent::__construct(CHAIN_HELMET, $meta, $count, "Chain Helmet");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMaterialDurability(){
|
||||||
|
return Material::CHAIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBaseDurability(){
|
||||||
|
return 11;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class ChainLeggingsItem extends Item{
|
class ChainLeggingsItem extends ArmorItem{
|
||||||
|
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(CHAIN_LEGGINGS, $meta, $count, "Chain Leggings");
|
parent::__construct(CHAIN_LEGGINGS, $meta, $count, "Chain Leggings");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMaterialDurability(){
|
||||||
|
return Material::CHAIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBaseDurability(){
|
||||||
|
return 15;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class DiamondBootsItem extends Item{
|
class DiamondBootsItem extends ArmorItem{
|
||||||
|
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(DIAMOND_BOOTS, $meta, $count, "Diamond Boots");
|
parent::__construct(DIAMOND_BOOTS, $meta, $count, "Diamond Boots");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMaterialDurability(){
|
||||||
|
return Material::DIAMOND;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBaseDurability(){
|
||||||
|
return 13;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class DiamondChestplateItem extends Item{
|
class DiamondChestplateItem extends ArmorItem{
|
||||||
|
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(DIAMOND_CHESTPLATE, $meta, $count, "Diamond Chestplate");
|
parent::__construct(DIAMOND_CHESTPLATE, $meta, $count, "Diamond Chestplate");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMaterialDurability(){
|
||||||
|
return Material::DIAMOND;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBaseDurability(){
|
||||||
|
return 16;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class DiamondHelmetItem extends Item{
|
class DiamondHelmetItem extends ArmorItem{
|
||||||
|
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(DIAMOND_HELMET, $meta, $count, "Diamond Helmet");
|
parent::__construct(DIAMOND_HELMET, $meta, $count, "Diamond Helmet");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMaterialDurability(){
|
||||||
|
return Material::DIAMOND;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBaseDurability(){
|
||||||
|
return 11;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class DiamondLeggingsItem extends Item{
|
class DiamondLeggingsItem extends ArmorItem{
|
||||||
|
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(DIAMOND_LEGGINGS, $meta, $count, "Diamond Leggings");
|
parent::__construct(DIAMOND_LEGGINGS, $meta, $count, "Diamond Leggings");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMaterialDurability(){
|
||||||
|
return Material::DIAMOND;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBaseDurability(){
|
||||||
|
return 15;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class GoldenBootsItem extends Item{
|
class GoldenBootsItem extends ArmorItem{
|
||||||
|
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(GOLDEN_BOOTS, $meta, $count, "Golden Boots");
|
parent::__construct(GOLDEN_BOOTS, $meta, $count, "Golden Boots");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMaterialDurability(){
|
||||||
|
return Material::GOLD;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBaseDurability(){
|
||||||
|
return 13;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class GoldenChestplateItem extends Item{
|
class GoldenChestplateItem extends ArmorItem{
|
||||||
|
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(GOLDEN_CHESTPLATE, $meta, $count, "Golden Chestplate");
|
parent::__construct(GOLDEN_CHESTPLATE, $meta, $count, "Golden Chestplate");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMaterialDurability(){
|
||||||
|
return Material::GOLD;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBaseDurability(){
|
||||||
|
return 16;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class GoldenHelmetItem extends Item{
|
class GoldenHelmetItem extends ArmorItem{
|
||||||
|
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(GOLDEN_HELMET, $meta, $count, "Golden Helmet");
|
parent::__construct(GOLDEN_HELMET, $meta, $count, "Golden Helmet");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMaterialDurability(){
|
||||||
|
return Material::GOLD;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBaseDurability(){
|
||||||
|
return 11;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class GoldenLeggingsItem extends Item{
|
class GoldenLeggingsItem extends ArmorItem{
|
||||||
|
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(GOLDEN_LEGGINGS, $meta, $count, "Golden Leggings");
|
parent::__construct(GOLDEN_LEGGINGS, $meta, $count, "Golden Leggings");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMaterialDurability(){
|
||||||
|
return Material::GOLD;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBaseDurability(){
|
||||||
|
return 15;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class IronBootsItem extends Item{
|
class IronBootsItem extends ArmorItem{
|
||||||
|
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(IRON_BOOTS, $meta, $count, "Iron Boots");
|
parent::__construct(IRON_BOOTS, $meta, $count, "Iron Boots");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMaterialDurability(){
|
||||||
|
return Material::IRON;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBaseDurability(){
|
||||||
|
return 13;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class IronChestplateItem extends Item{
|
class IronChestplateItem extends ArmorItem{
|
||||||
|
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(IRON_CHESTPLATE, $meta, $count, "Iron Chestplate");
|
parent::__construct(IRON_CHESTPLATE, $meta, $count, "Iron Chestplate");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMaterialDurability(){
|
||||||
|
return Material::IRON;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBaseDurability(){
|
||||||
|
return 16;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class IronHelmetItem extends Item{
|
class IronHelmetItem extends ArmorItem{
|
||||||
|
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(IRON_HELMET, $meta, $count, "Iron Helmet");
|
parent::__construct(IRON_HELMET, $meta, $count, "Iron Helmet");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMaterialDurability(){
|
||||||
|
return Material::IRON;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBaseDurability(){
|
||||||
|
return 11;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class IronLeggingsItem extends Item{
|
class IronLeggingsItem extends ArmorItem{
|
||||||
|
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(IRON_LEGGINGS, $meta, $count, "Iron Leggings");
|
parent::__construct(IRON_LEGGINGS, $meta, $count, "Iron Leggings");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMaterialDurability(){
|
||||||
|
return Material::IRON;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBaseDurability(){
|
||||||
|
return 15;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class LeatherBootsItem extends Item{
|
class LeatherBootsItem extends ArmorItem{
|
||||||
|
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(LEATHER_BOOTS, $meta, $count, "Leather Boots");
|
parent::__construct(LEATHER_BOOTS, $meta, $count, "Leather Boots");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMaterialDurability(){
|
||||||
|
return Material::LEATHER;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBaseDurability(){
|
||||||
|
return 13;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class LeatherCapItem extends Item{
|
class LeatherCapItem extends ArmorItem{
|
||||||
|
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(LEATHER_CAP, $meta, $count, "Leather Cap");
|
parent::__construct(LEATHER_CAP, $meta, $count, "Leather Cap");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMaterialDurability(){
|
||||||
|
return Material::LEATHER;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBaseDurability(){
|
||||||
|
return 11;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class LeatherPantsItem extends Item{
|
class LeatherPantsItem extends ArmorItem{
|
||||||
|
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(LEATHER_PANTS, $meta, $count, "Leather Pants");
|
parent::__construct(LEATHER_PANTS, $meta, $count, "Leather Pants");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMaterialDurability(){
|
||||||
|
return Material::LEATHER;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBaseDurability(){
|
||||||
|
return 15;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class LeatherTunicItem extends Item{
|
class LeatherTunicItem extends ArmorItem{
|
||||||
|
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(LEATHER_TUNIC, $meta, $count, "Leather Tunic");
|
parent::__construct(LEATHER_TUNIC, $meta, $count, "Leather Tunic");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMaterialDurability(){
|
||||||
|
return Material::LEATHER;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBaseDurability(){
|
||||||
|
return 16;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4,5 +4,7 @@ class BowItem extends Item{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(BOW, 0, $count, "Bow");
|
parent::__construct(BOW, 0, $count, "Bow");
|
||||||
}
|
}
|
||||||
|
public function isTool(){ //it is tool too
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,4 +5,7 @@ class DiamondAxeItem extends Item{
|
||||||
parent::__construct(DIAMOND_AXE, $meta, $count, "Diamond Axe");
|
parent::__construct(DIAMOND_AXE, $meta, $count, "Diamond Axe");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,4 +5,7 @@ class DiamondHoeItem extends Item{
|
||||||
parent::__construct(DIAMOND_HOE, $meta, $count, "Diamond Hoe");
|
parent::__construct(DIAMOND_HOE, $meta, $count, "Diamond Hoe");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,4 +5,7 @@ class DiamondPickaxeItem extends Item{
|
||||||
parent::__construct(DIAMOND_PICKAXE, $meta, $count, "Diamond Pickaxe");
|
parent::__construct(DIAMOND_PICKAXE, $meta, $count, "Diamond Pickaxe");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,4 +5,7 @@ class DiamondShovelItem extends Item{
|
||||||
parent::__construct(DIAMOND_SHOVEL, $meta, $count, "Diamond Shovel");
|
parent::__construct(DIAMOND_SHOVEL, $meta, $count, "Diamond Shovel");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4,5 +4,7 @@ class DiamondSwordItem extends Item{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(DIAMOND_SWORD, $meta, $count, "Diamond Sword");
|
parent::__construct(DIAMOND_SWORD, $meta, $count, "Diamond Sword");
|
||||||
}
|
}
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -19,4 +19,8 @@ class FlintSteelItem extends Item{
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,4 +5,7 @@ class GoldenAxeItem extends Item{
|
||||||
parent::__construct(GOLDEN_AXE, $meta, $count, "Golden Axe");
|
parent::__construct(GOLDEN_AXE, $meta, $count, "Golden Axe");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,4 +5,7 @@ class GoldenHoeItem extends Item{
|
||||||
parent::__construct(GOLDEN_HOE, $meta, $count, "Golden Hoe");
|
parent::__construct(GOLDEN_HOE, $meta, $count, "Golden Hoe");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,4 +5,7 @@ class GoldenPickaxeItem extends Item{
|
||||||
parent::__construct(GOLDEN_PICKAXE, $meta, $count, "Golden Pickaxe");
|
parent::__construct(GOLDEN_PICKAXE, $meta, $count, "Golden Pickaxe");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,4 +5,7 @@ class GoldenShovelItem extends Item{
|
||||||
parent::__construct(GOLDEN_SHOVEL, $meta, $count, "Golden Shovel");
|
parent::__construct(GOLDEN_SHOVEL, $meta, $count, "Golden Shovel");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4,5 +4,7 @@ class GoldenSwordItem extends Item{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(GOLDEN_SWORD, $meta, $count, "Golden Sword");
|
parent::__construct(GOLDEN_SWORD, $meta, $count, "Golden Sword");
|
||||||
}
|
}
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,4 +5,7 @@ class IronAxeItem extends Item{
|
||||||
parent::__construct(IRON_AXE, $meta, $count, "Iron Axe");
|
parent::__construct(IRON_AXE, $meta, $count, "Iron Axe");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,4 +5,7 @@ class IronHoeItem extends Item{
|
||||||
parent::__construct(IRON_HOE, $meta, $count, "Iron Hoe");
|
parent::__construct(IRON_HOE, $meta, $count, "Iron Hoe");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,4 +5,7 @@ class IronPickaxeItem extends Item{
|
||||||
parent::__construct(IRON_PICKAXE, $meta, $count, "Iron Pickaxe");
|
parent::__construct(IRON_PICKAXE, $meta, $count, "Iron Pickaxe");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,4 +5,7 @@ class IronShovelItem extends Item{
|
||||||
parent::__construct(IRON_SHOVEL, $meta, $count, "Iron Shovel");
|
parent::__construct(IRON_SHOVEL, $meta, $count, "Iron Shovel");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4,5 +4,7 @@ class IronSwordItem extends Item{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(IRON_SWORD, $meta, $count, "Iron Sword");
|
parent::__construct(IRON_SWORD, $meta, $count, "Iron Sword");
|
||||||
}
|
}
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,4 +5,7 @@ class ShearsItem extends Item{
|
||||||
parent::__construct(SHEARS, $meta, $count, "Shears");
|
parent::__construct(SHEARS, $meta, $count, "Shears");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,4 +5,7 @@ class StoneAxeItem extends Item{
|
||||||
parent::__construct(STONE_AXE, $meta, $count, "Stone Axe");
|
parent::__construct(STONE_AXE, $meta, $count, "Stone Axe");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,4 +5,7 @@ class StoneHoeItem extends Item{
|
||||||
parent::__construct(STONE_HOE, $meta, $count, "Stone Hoe");
|
parent::__construct(STONE_HOE, $meta, $count, "Stone Hoe");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,4 +5,7 @@ class StonePickaxeItem extends Item{
|
||||||
parent::__construct(STONE_PICKAXE, $meta, $count, "Stone Pickaxe");
|
parent::__construct(STONE_PICKAXE, $meta, $count, "Stone Pickaxe");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4,5 +4,7 @@ class StoneSwordItem extends Item{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(STONE_SWORD, $meta, $count, "Stone Sword");
|
parent::__construct(STONE_SWORD, $meta, $count, "Stone Sword");
|
||||||
}
|
}
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,4 +5,7 @@ class WoodenAxeItem extends Item{
|
||||||
parent::__construct(WOODEN_AXE, $meta, $count, "Wooden Axe");
|
parent::__construct(WOODEN_AXE, $meta, $count, "Wooden Axe");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,4 +5,7 @@ class WoodenHoeItem extends Item{
|
||||||
parent::__construct(WOODEN_HOE, $meta, $count, "Wooden Hoe");
|
parent::__construct(WOODEN_HOE, $meta, $count, "Wooden Hoe");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5,4 +5,7 @@ class WoodenPickaxeItem extends Item{
|
||||||
parent::__construct(WOODEN_PICKAXE, $meta, $count, "Wooden Pickaxe");
|
parent::__construct(WOODEN_PICKAXE, $meta, $count, "Wooden Pickaxe");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,4 +5,7 @@ class WoodenShovelItem extends Item{
|
||||||
parent::__construct(WOODEN_SHOVEL, $meta, $count, "Wooden Shovel");
|
parent::__construct(WOODEN_SHOVEL, $meta, $count, "Wooden Shovel");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,5 +4,7 @@ class WoodenSwordItem extends Item{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(WOODEN_SWORD, $meta, $count, "Wooden Sword");
|
parent::__construct(WOODEN_SWORD, $meta, $count, "Wooden Sword");
|
||||||
}
|
}
|
||||||
|
public function isTool(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue