Some minor tool cleanup

This commit is contained in:
Dylan K. Taylor 2017-08-25 13:19:21 +01:00
parent cd7724d94a
commit 7ff143c793
4 changed files with 17 additions and 29 deletions

View File

@ -33,4 +33,7 @@ class Bow extends Tool{
return 200;
}
public function getMaxDurability(){
return 385;
}
}

View File

@ -52,4 +52,8 @@ class FlintSteel extends Tool{
return false;
}
public function getMaxDurability(){
return 65;
}
}

View File

@ -28,4 +28,12 @@ class Shears extends Tool{
public function __construct($meta = 0, $count = 1){
parent::__construct(self::SHEARS, $meta, $count, "Shears");
}
public function getMaxDurability(){
return 239;
}
public function isShears(){
return true;
}
}

View File

@ -97,10 +97,7 @@ abstract class Tool extends Item{
Tool::TIER_WOODEN => 60,
Tool::TIER_STONE => 132,
Tool::TIER_IRON => 251,
Tool::TIER_DIAMOND => 1562,
self::FLINT_STEEL => 65,
self::SHEARS => 239,
self::BOW => 385,
Tool::TIER_DIAMOND => 1562
];
if(($type = $this->isPickaxe()) === false){
@ -123,31 +120,7 @@ abstract class Tool extends Item{
return $tag !== null and $tag->getValue() > 0;
}
public function isPickaxe(){
return false;
}
public function isAxe(){
return false;
}
public function isSword(){
return false;
}
public function isShovel(){
return false;
}
public function isHoe(){
return false;
}
public function isShears(){
return ($this->id === self::SHEARS);
}
public function isTool(){
return ($this->id === self::FLINT_STEEL or $this->id === self::SHEARS or $this->id === self::BOW or $this->isPickaxe() !== false or $this->isAxe() !== false or $this->isShovel() !== false or $this->isSword() !== false);
return true;
}
}