mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 15:05:33 +00:00
Some minor tool cleanup
This commit is contained in:
parent
cd7724d94a
commit
7ff143c793
@ -33,4 +33,7 @@ class Bow extends Tool{
|
||||
return 200;
|
||||
}
|
||||
|
||||
public function getMaxDurability(){
|
||||
return 385;
|
||||
}
|
||||
}
|
@ -52,4 +52,8 @@ class FlintSteel extends Tool{
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getMaxDurability(){
|
||||
return 65;
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user