mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Removed damage-table mess and added API methods Item->getAttackPoints() and Item->getDefensePoints()
This commit is contained in:
@ -28,4 +28,8 @@ class ChainBoots extends Armor{
|
||||
public function __construct(int $meta = 0){
|
||||
parent::__construct(self::CHAIN_BOOTS, $meta, "Chainmail Boots");
|
||||
}
|
||||
|
||||
public function getDefensePoints() : int{
|
||||
return 1;
|
||||
}
|
||||
}
|
@ -28,4 +28,8 @@ class ChainChestplate extends Armor{
|
||||
public function __construct(int $meta = 0){
|
||||
parent::__construct(self::CHAIN_CHESTPLATE, $meta, "Chain Chestplate");
|
||||
}
|
||||
|
||||
public function getDefensePoints() : int{
|
||||
return 5;
|
||||
}
|
||||
}
|
@ -28,4 +28,8 @@ class ChainHelmet extends Armor{
|
||||
public function __construct(int $meta = 0){
|
||||
parent::__construct(self::CHAIN_HELMET, $meta, "Chainmail Helmet");
|
||||
}
|
||||
|
||||
public function getDefensePoints() : int{
|
||||
return 2;
|
||||
}
|
||||
}
|
@ -28,4 +28,8 @@ class ChainLeggings extends Armor{
|
||||
public function __construct(int $meta = 0){
|
||||
parent::__construct(self::CHAIN_LEGGINGS, $meta, "Chain Leggings");
|
||||
}
|
||||
|
||||
public function getDefensePoints() : int{
|
||||
return 4;
|
||||
}
|
||||
}
|
@ -33,4 +33,7 @@ class DiamondAxe extends Tool{
|
||||
return Tool::TIER_DIAMOND;
|
||||
}
|
||||
|
||||
public function getAttackPoints() : int{
|
||||
return 7;
|
||||
}
|
||||
}
|
@ -28,4 +28,8 @@ class DiamondBoots extends Armor{
|
||||
public function __construct(int $meta = 0){
|
||||
parent::__construct(self::DIAMOND_BOOTS, $meta, "Diamond Boots");
|
||||
}
|
||||
|
||||
public function getDefensePoints() : int{
|
||||
return 3;
|
||||
}
|
||||
}
|
@ -28,4 +28,8 @@ class DiamondChestplate extends Armor{
|
||||
public function __construct(int $meta = 0){
|
||||
parent::__construct(self::DIAMOND_CHESTPLATE, $meta, "Diamond Chestplate");
|
||||
}
|
||||
|
||||
public function getDefensePoints() : int{
|
||||
return 8;
|
||||
}
|
||||
}
|
@ -28,4 +28,8 @@ class DiamondHelmet extends Armor{
|
||||
public function __construct(int $meta = 0){
|
||||
parent::__construct(self::DIAMOND_HELMET, $meta, "Diamond Helmet");
|
||||
}
|
||||
|
||||
public function getDefensePoints() : int{
|
||||
return 3;
|
||||
}
|
||||
}
|
@ -28,4 +28,8 @@ class DiamondLeggings extends Armor{
|
||||
public function __construct(int $meta = 0){
|
||||
parent::__construct(self::DIAMOND_LEGGINGS, $meta, "Diamond Leggings");
|
||||
}
|
||||
|
||||
public function getDefensePoints() : int{
|
||||
return 6;
|
||||
}
|
||||
}
|
@ -32,4 +32,8 @@ class DiamondPickaxe extends Tool{
|
||||
public function isPickaxe(){
|
||||
return Tool::TIER_DIAMOND;
|
||||
}
|
||||
|
||||
public function getAttackPoints() : int{
|
||||
return 6;
|
||||
}
|
||||
}
|
||||
|
@ -32,4 +32,8 @@ class DiamondShovel extends Tool{
|
||||
public function isShovel(){
|
||||
return Tool::TIER_DIAMOND;
|
||||
}
|
||||
|
||||
public function getAttackPoints() : int{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
|
@ -32,4 +32,8 @@ class DiamondSword extends Tool{
|
||||
public function isSword(){
|
||||
return Tool::TIER_DIAMOND;
|
||||
}
|
||||
|
||||
public function getAttackPoints() : int{
|
||||
return 8;
|
||||
}
|
||||
}
|
||||
|
@ -32,4 +32,8 @@ class GoldAxe extends Tool{
|
||||
public function isAxe(){
|
||||
return Tool::TIER_GOLD;
|
||||
}
|
||||
|
||||
public function getAttackPoints() : int{
|
||||
return 4;
|
||||
}
|
||||
}
|
@ -28,4 +28,8 @@ class GoldBoots extends Armor{
|
||||
public function __construct(int $meta = 0){
|
||||
parent::__construct(self::GOLD_BOOTS, $meta, "Gold Boots");
|
||||
}
|
||||
|
||||
public function getDefensePoints() : int{
|
||||
return 1;
|
||||
}
|
||||
}
|
@ -28,4 +28,8 @@ class GoldChestplate extends Armor{
|
||||
public function __construct(int $meta = 0){
|
||||
parent::__construct(self::GOLD_CHESTPLATE, $meta, "Gold Chestplate");
|
||||
}
|
||||
|
||||
public function getDefensePoints() : int{
|
||||
return 5;
|
||||
}
|
||||
}
|
@ -28,4 +28,8 @@ class GoldHelmet extends Armor{
|
||||
public function __construct(int $meta = 0){
|
||||
parent::__construct(self::GOLD_HELMET, $meta, "Gold Helmet");
|
||||
}
|
||||
|
||||
public function getDefensePoints() : int{
|
||||
return 2;
|
||||
}
|
||||
}
|
@ -28,4 +28,8 @@ class GoldLeggings extends Armor{
|
||||
public function __construct(int $meta = 0){
|
||||
parent::__construct(self::GOLD_LEGGINGS, $meta, "Gold Leggings");
|
||||
}
|
||||
|
||||
public function getDefensePoints() : int{
|
||||
return 3;
|
||||
}
|
||||
}
|
@ -32,4 +32,8 @@ class GoldPickaxe extends Tool{
|
||||
public function isPickaxe(){
|
||||
return Tool::TIER_GOLD;
|
||||
}
|
||||
|
||||
public function getAttackPoints() : int{
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
@ -32,4 +32,8 @@ class GoldShovel extends Tool{
|
||||
public function isShovel(){
|
||||
return Tool::TIER_GOLD;
|
||||
}
|
||||
|
||||
public function getAttackPoints() : int{
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
@ -32,4 +32,8 @@ class GoldSword extends Tool{
|
||||
public function isSword(){
|
||||
return Tool::TIER_GOLD;
|
||||
}
|
||||
|
||||
public function getAttackPoints() : int{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
|
@ -32,4 +32,8 @@ class IronAxe extends Tool{
|
||||
public function isAxe(){
|
||||
return Tool::TIER_IRON;
|
||||
}
|
||||
|
||||
public function getAttackPoints() : int{
|
||||
return 6;
|
||||
}
|
||||
}
|
@ -28,4 +28,8 @@ class IronBoots extends Armor{
|
||||
public function __construct(int $meta = 0){
|
||||
parent::__construct(self::IRON_BOOTS, $meta, "Iron Boots");
|
||||
}
|
||||
|
||||
public function getDefensePoints() : int{
|
||||
return 2;
|
||||
}
|
||||
}
|
@ -28,4 +28,8 @@ class IronChestplate extends Armor{
|
||||
public function __construct(int $meta = 0){
|
||||
parent::__construct(self::IRON_CHESTPLATE, $meta, "Iron Chestplate");
|
||||
}
|
||||
|
||||
public function getDefensePoints() : int{
|
||||
return 6;
|
||||
}
|
||||
}
|
@ -28,4 +28,8 @@ class IronHelmet extends Armor{
|
||||
public function __construct(int $meta = 0){
|
||||
parent::__construct(self::IRON_HELMET, $meta, "Iron Helmet");
|
||||
}
|
||||
|
||||
public function getDefensePoints() : int{
|
||||
return 2;
|
||||
}
|
||||
}
|
@ -28,4 +28,8 @@ class IronLeggings extends Armor{
|
||||
public function __construct(int $meta = 0){
|
||||
parent::__construct(self::IRON_LEGGINGS, $meta, "Iron Leggings");
|
||||
}
|
||||
|
||||
public function getDefensePoints() : int{
|
||||
return 5;
|
||||
}
|
||||
}
|
@ -32,4 +32,8 @@ class IronPickaxe extends Tool{
|
||||
public function isPickaxe(){
|
||||
return Tool::TIER_IRON;
|
||||
}
|
||||
|
||||
public function getAttackPoints() : int{
|
||||
return 5;
|
||||
}
|
||||
}
|
@ -32,4 +32,8 @@ class IronShovel extends Tool{
|
||||
public function isShovel(){
|
||||
return Tool::TIER_IRON;
|
||||
}
|
||||
|
||||
public function getAttackPoints() : int{
|
||||
return 4;
|
||||
}
|
||||
}
|
@ -32,4 +32,8 @@ class IronSword extends Tool{
|
||||
public function isSword(){
|
||||
return Tool::TIER_IRON;
|
||||
}
|
||||
|
||||
public function getAttackPoints() : int{
|
||||
return 7;
|
||||
}
|
||||
}
|
@ -746,6 +746,22 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns how many points of damage this item will deal to an entity when used as a weapon.
|
||||
* @return int
|
||||
*/
|
||||
public function getAttackPoints() : int{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns how many armor points can be gained by wearing this item.
|
||||
* @return int
|
||||
*/
|
||||
public function getDefensePoints() : int{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Entity|Block $object
|
||||
*
|
||||
|
@ -28,4 +28,8 @@ class LeatherBoots extends Armor{
|
||||
public function __construct(int $meta = 0){
|
||||
parent::__construct(self::LEATHER_BOOTS, $meta, "Leather Boots");
|
||||
}
|
||||
|
||||
public function getDefensePoints() : int{
|
||||
return 1;
|
||||
}
|
||||
}
|
@ -28,4 +28,8 @@ class LeatherCap extends Armor{
|
||||
public function __construct(int $meta = 0){
|
||||
parent::__construct(self::LEATHER_CAP, $meta, "Leather Cap");
|
||||
}
|
||||
|
||||
public function getDefensePoints() : int{
|
||||
return 1;
|
||||
}
|
||||
}
|
@ -28,4 +28,8 @@ class LeatherPants extends Armor{
|
||||
public function __construct(int $meta = 0){
|
||||
parent::__construct(self::LEATHER_PANTS, $meta, "Leather Pants");
|
||||
}
|
||||
|
||||
public function getDefensePoints() : int{
|
||||
return 2;
|
||||
}
|
||||
}
|
@ -28,4 +28,8 @@ class LeatherTunic extends Armor{
|
||||
public function __construct(int $meta = 0){
|
||||
parent::__construct(self::LEATHER_TUNIC, $meta, "Leather Tunic");
|
||||
}
|
||||
|
||||
public function getDefensePoints() : int{
|
||||
return 3;
|
||||
}
|
||||
}
|
@ -33,4 +33,8 @@ class StoneAxe extends Tool{
|
||||
public function isAxe(){
|
||||
return Tool::TIER_STONE;
|
||||
}
|
||||
|
||||
public function getAttackPoints() : int{
|
||||
return 5;
|
||||
}
|
||||
}
|
@ -32,4 +32,8 @@ class StonePickaxe extends Tool{
|
||||
public function isPickaxe(){
|
||||
return Tool::TIER_STONE;
|
||||
}
|
||||
|
||||
public function getAttackPoints() : int{
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
@ -32,4 +32,8 @@ class StoneShovel extends Tool{
|
||||
public function isShovel(){
|
||||
return Tool::TIER_STONE;
|
||||
}
|
||||
|
||||
public function getAttackPoints() : int{
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
@ -32,4 +32,8 @@ class StoneSword extends Tool{
|
||||
public function isSword(){
|
||||
return Tool::TIER_STONE;
|
||||
}
|
||||
|
||||
public function getAttackPoints() : int{
|
||||
return 6;
|
||||
}
|
||||
}
|
||||
|
@ -36,4 +36,8 @@ class WoodenAxe extends Tool{
|
||||
public function getFuelTime() : int{
|
||||
return 200;
|
||||
}
|
||||
|
||||
public function getAttackPoints() : int{
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
@ -36,4 +36,8 @@ class WoodenPickaxe extends Tool{
|
||||
public function getFuelTime() : int{
|
||||
return 200;
|
||||
}
|
||||
|
||||
public function getAttackPoints() : int{
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
@ -36,4 +36,8 @@ class WoodenShovel extends Tool{
|
||||
public function getFuelTime() : int{
|
||||
return 200;
|
||||
}
|
||||
|
||||
public function getAttackPoints() : int{
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
@ -36,4 +36,8 @@ class WoodenSword extends Tool{
|
||||
public function getFuelTime() : int{
|
||||
return 200;
|
||||
}
|
||||
|
||||
public function getAttackPoints() : int{
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user