mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-09 15:29:47 +00:00
Unify Item constructor style
this exposed a few more dead classes.
This commit is contained in:
parent
51f96b195e
commit
c99846e069
@ -25,9 +25,6 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
|
|
||||||
class Apple extends Food{
|
class Apple extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::APPLE, 0, "Apple");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 4;
|
return 4;
|
||||||
|
@ -24,7 +24,5 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class Arrow extends Item{
|
class Arrow extends Item{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::ARROW, 0, "Arrow");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class BakedPotato extends Food{
|
class BakedPotato extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::BAKED_POTATO, 0, "Baked Potato");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 5;
|
return 5;
|
||||||
|
@ -41,8 +41,8 @@ class Banner extends Item{
|
|||||||
/** @var DyeColor */
|
/** @var DyeColor */
|
||||||
private $color;
|
private $color;
|
||||||
|
|
||||||
public function __construct(int $variant, string $name, DyeColor $color){
|
public function __construct(int $id, int $variant, string $name, DyeColor $color){
|
||||||
parent::__construct(self::BANNER, $variant, $name);
|
parent::__construct($id, $variant, $name);
|
||||||
$this->color = $color;
|
$this->color = $color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,8 +33,8 @@ class Bed extends Item{
|
|||||||
/** @var DyeColor */
|
/** @var DyeColor */
|
||||||
private $color;
|
private $color;
|
||||||
|
|
||||||
public function __construct(int $variant, string $name, DyeColor $color){
|
public function __construct(int $id, int $variant, string $name, DyeColor $color){
|
||||||
parent::__construct(self::BED, $variant, $name);
|
parent::__construct($id, $variant, $name);
|
||||||
$this->color = $color;
|
$this->color = $color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class Beetroot extends Food{
|
class Beetroot extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::BEETROOT, 0, "Beetroot");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -28,9 +28,6 @@ use pocketmine\block\BlockFactory;
|
|||||||
use pocketmine\block\BlockLegacyIds;
|
use pocketmine\block\BlockLegacyIds;
|
||||||
|
|
||||||
class BeetrootSeeds extends Item{
|
class BeetrootSeeds extends Item{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::BEETROOT_SEEDS, 0, "Beetroot Seeds");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getBlock() : Block{
|
public function getBlock() : Block{
|
||||||
return BlockFactory::get(BlockLegacyIds::BEETROOT_BLOCK);
|
return BlockFactory::get(BlockLegacyIds::BEETROOT_BLOCK);
|
||||||
|
@ -25,9 +25,6 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
|
|
||||||
class BeetrootSoup extends Food{
|
class BeetrootSoup extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::BEETROOT_SOUP, 0, "Beetroot Soup");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxStackSize() : int{
|
public function getMaxStackSize() : int{
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -25,10 +25,6 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class BlazeRod extends Item{
|
class BlazeRod extends Item{
|
||||||
|
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::BLAZE_ROD, 0, "Blaze Rod");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFuelTime() : int{
|
public function getFuelTime() : int{
|
||||||
return 2400;
|
return 2400;
|
||||||
}
|
}
|
||||||
|
@ -29,8 +29,8 @@ class Boat extends Item{
|
|||||||
/** @var TreeType */
|
/** @var TreeType */
|
||||||
private $woodType;
|
private $woodType;
|
||||||
|
|
||||||
public function __construct(TreeType $woodType){
|
public function __construct(int $id, int $variant, string $name, TreeType $woodType){
|
||||||
parent::__construct(self::BOAT, $woodType->getMagicNumber(), $woodType->getDisplayName() . " Boat");
|
parent::__construct($id, $variant, $name);
|
||||||
$this->woodType = $woodType;
|
$this->woodType = $woodType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,5 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class Book extends Item{
|
class Book extends Item{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::BOOK, 0, "Book");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -29,15 +29,12 @@ use pocketmine\entity\projectile\Projectile;
|
|||||||
use pocketmine\event\entity\EntityShootBowEvent;
|
use pocketmine\event\entity\EntityShootBowEvent;
|
||||||
use pocketmine\event\entity\ProjectileLaunchEvent;
|
use pocketmine\event\entity\ProjectileLaunchEvent;
|
||||||
use pocketmine\item\enchantment\Enchantment;
|
use pocketmine\item\enchantment\Enchantment;
|
||||||
use pocketmine\world\sound\BowShootSound;
|
|
||||||
use pocketmine\Player;
|
use pocketmine\Player;
|
||||||
|
use pocketmine\world\sound\BowShootSound;
|
||||||
use function intdiv;
|
use function intdiv;
|
||||||
use function min;
|
use function min;
|
||||||
|
|
||||||
class Bow extends Tool{
|
class Bow extends Tool{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::BOW, 0, "Bow");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFuelTime() : int{
|
public function getFuelTime() : int{
|
||||||
return 200;
|
return 200;
|
||||||
|
@ -25,9 +25,6 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
|
|
||||||
class Bowl extends Item{
|
class Bowl extends Item{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::BOWL, 0, "Bowl");
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO: check fuel
|
//TODO: check fuel
|
||||||
}
|
}
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class Bread extends Food{
|
class Bread extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::BREAD, 0, "Bread");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 5;
|
return 5;
|
||||||
|
@ -28,9 +28,6 @@ use pocketmine\block\BlockFactory;
|
|||||||
use pocketmine\block\BlockLegacyIds;
|
use pocketmine\block\BlockLegacyIds;
|
||||||
|
|
||||||
class Carrot extends Food{
|
class Carrot extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::CARROT, 0, "Carrot");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getBlock() : Block{
|
public function getBlock() : Block{
|
||||||
return BlockFactory::get(BlockLegacyIds::CARROT_BLOCK);
|
return BlockFactory::get(BlockLegacyIds::CARROT_BLOCK);
|
||||||
|
@ -33,10 +33,6 @@ use function mt_rand;
|
|||||||
|
|
||||||
class ChorusFruit extends Food{
|
class ChorusFruit extends Food{
|
||||||
|
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::CHORUS_FRUIT, 0, "Chorus Fruit");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,5 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class Clock extends Item{
|
class Clock extends Item{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::CLOCK, 0, "Clock");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class Clownfish extends Food{
|
class Clownfish extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::CLOWNFISH, 0, "Clownfish");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -24,7 +24,5 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class Compass extends Item{
|
class Compass extends Item{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::COMPASS, 0, "Compass");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class CookedChicken extends Food{
|
class CookedChicken extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::COOKED_CHICKEN, 0, "Cooked Chicken");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 6;
|
return 6;
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class CookedFish extends Food{
|
class CookedFish extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::COOKED_FISH, 0, "Cooked Fish");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 5;
|
return 5;
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class CookedMutton extends Food{
|
class CookedMutton extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::COOKED_MUTTON, 0, "Cooked Mutton");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 6;
|
return 6;
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class CookedPorkchop extends Food{
|
class CookedPorkchop extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::COOKED_PORKCHOP, 0, "Cooked Porkchop");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 8;
|
return 8;
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class CookedRabbit extends Food{
|
class CookedRabbit extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::COOKED_RABBIT, 0, "Cooked Rabbit");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 5;
|
return 5;
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class CookedSalmon extends Food{
|
class CookedSalmon extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::COOKED_SALMON, 0, "Cooked Salmon");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 6;
|
return 6;
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class Cookie extends Food{
|
class Cookie extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::COOKIE, 0, "Cookie");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 2;
|
return 2;
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class DriedKelp extends Food{
|
class DriedKelp extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::DRIED_KELP, 0, "Dried Kelp");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -30,8 +30,8 @@ class Dye extends Item{
|
|||||||
/** @var DyeColor */
|
/** @var DyeColor */
|
||||||
private $color;
|
private $color;
|
||||||
|
|
||||||
public function __construct(int $variant, string $name, DyeColor $color){
|
public function __construct(int $id, int $variant, string $name, DyeColor $color){
|
||||||
parent::__construct(self::DYE, $variant, $name);
|
parent::__construct($id, $variant, $name);
|
||||||
$this->color = $color;
|
$this->color = $color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,9 +26,6 @@ namespace pocketmine\item;
|
|||||||
use pocketmine\entity\projectile\Egg as EggEntity;
|
use pocketmine\entity\projectile\Egg as EggEntity;
|
||||||
|
|
||||||
class Egg extends ProjectileItem{
|
class Egg extends ProjectileItem{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::EGG, 0, "Egg");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxStackSize() : int{
|
public function getMaxStackSize() : int{
|
||||||
return 16;
|
return 16;
|
||||||
|
@ -26,9 +26,6 @@ namespace pocketmine\item;
|
|||||||
use pocketmine\entity\projectile\EnderPearl as EnderPearlEntity;
|
use pocketmine\entity\projectile\EnderPearl as EnderPearlEntity;
|
||||||
|
|
||||||
class EnderPearl extends ProjectileItem{
|
class EnderPearl extends ProjectileItem{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::ENDER_PEARL, 0, "Ender Pearl");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxStackSize() : int{
|
public function getMaxStackSize() : int{
|
||||||
return 16;
|
return 16;
|
||||||
|
@ -26,9 +26,6 @@ namespace pocketmine\item;
|
|||||||
use pocketmine\entity\projectile\ExperienceBottle as ExperienceBottleEntity;
|
use pocketmine\entity\projectile\ExperienceBottle as ExperienceBottleEntity;
|
||||||
|
|
||||||
class ExperienceBottle extends ProjectileItem{
|
class ExperienceBottle extends ProjectileItem{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::EXPERIENCE_BOTTLE, 0, "Bottle o' Enchanting");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getProjectileEntityClass() : string{
|
public function getProjectileEntityClass() : string{
|
||||||
return ExperienceBottleEntity::class;
|
return ExperienceBottleEntity::class;
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class FishingRod extends Item{
|
class FishingRod extends Item{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::FISHING_ROD, 0, "Fishing Rod");
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
@ -32,9 +32,6 @@ use pocketmine\world\sound\FlintSteelSound;
|
|||||||
use function assert;
|
use function assert;
|
||||||
|
|
||||||
class FlintSteel extends Tool{
|
class FlintSteel extends Tool{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::FLINT_STEEL, 0, "Flint and Steel");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function onActivate(Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector) : ItemUseResult{
|
public function onActivate(Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector) : ItemUseResult{
|
||||||
if($blockReplace->getId() === BlockLegacyIds::AIR){
|
if($blockReplace->getId() === BlockLegacyIds::AIR){
|
||||||
|
@ -24,7 +24,5 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class GlassBottle extends Item{
|
class GlassBottle extends Item{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::GLASS_BOTTLE, 0, "Glass Bottle");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -28,10 +28,6 @@ use pocketmine\entity\effect\EffectInstance;
|
|||||||
|
|
||||||
class GoldenApple extends Food{
|
class GoldenApple extends Food{
|
||||||
|
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::GOLDEN_APPLE, 0, "Golden Apple");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function requiresHunger() : bool{
|
public function requiresHunger() : bool{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -28,10 +28,6 @@ use pocketmine\entity\effect\EffectInstance;
|
|||||||
|
|
||||||
class GoldenAppleEnchanted extends GoldenApple{
|
class GoldenAppleEnchanted extends GoldenApple{
|
||||||
|
|
||||||
public function __construct(){
|
|
||||||
Food::__construct(self::ENCHANTED_GOLDEN_APPLE, 0, "Enchanted Golden Apple"); //skip parent constructor
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getAdditionalEffects() : array{
|
public function getAdditionalEffects() : array{
|
||||||
return [
|
return [
|
||||||
new EffectInstance(Effect::REGENERATION(), 600, 4),
|
new EffectInstance(Effect::REGENERATION(), 600, 4),
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class GoldenCarrot extends Food{
|
class GoldenCarrot extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::GOLDEN_CARROT, 0, "Golden Carrot");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 6;
|
return 6;
|
||||||
|
@ -54,59 +54,59 @@ class ItemFactory{
|
|||||||
public static function init() : void{
|
public static function init() : void{
|
||||||
self::$list = []; //in case of re-initializing
|
self::$list = []; //in case of re-initializing
|
||||||
|
|
||||||
self::register(new Apple());
|
self::register(new Apple(Item::APPLE, 0, "Apple"));
|
||||||
self::register(new Arrow());
|
self::register(new Arrow(Item::ARROW, 0, "Arrow"));
|
||||||
self::register(new Axe(Item::DIAMOND_AXE, "Diamond Axe", TieredTool::TIER_DIAMOND));
|
self::register(new Axe(Item::DIAMOND_AXE, "Diamond Axe", TieredTool::TIER_DIAMOND));
|
||||||
self::register(new Axe(Item::GOLDEN_AXE, "Gold Axe", TieredTool::TIER_GOLD));
|
self::register(new Axe(Item::GOLDEN_AXE, "Gold Axe", TieredTool::TIER_GOLD));
|
||||||
self::register(new Axe(Item::IRON_AXE, "Iron Axe", TieredTool::TIER_IRON));
|
self::register(new Axe(Item::IRON_AXE, "Iron Axe", TieredTool::TIER_IRON));
|
||||||
self::register(new Axe(Item::STONE_AXE, "Stone Axe", TieredTool::TIER_STONE));
|
self::register(new Axe(Item::STONE_AXE, "Stone Axe", TieredTool::TIER_STONE));
|
||||||
self::register(new Axe(Item::WOODEN_AXE, "Wooden Axe", TieredTool::TIER_WOODEN));
|
self::register(new Axe(Item::WOODEN_AXE, "Wooden Axe", TieredTool::TIER_WOODEN));
|
||||||
self::register(new BakedPotato());
|
self::register(new BakedPotato(Item::BAKED_POTATO, 0, "Baked Potato"));
|
||||||
self::register(new Beetroot());
|
self::register(new Beetroot(Item::BEETROOT, 0, "Beetroot"));
|
||||||
self::register(new BeetrootSeeds());
|
self::register(new BeetrootSeeds(Item::BEETROOT_SEEDS, 0, "Beetroot Seeds"));
|
||||||
self::register(new BeetrootSoup());
|
self::register(new BeetrootSoup(Item::BEETROOT_SOUP, 0, "Beetroot Soup"));
|
||||||
self::register(new BlazeRod());
|
self::register(new BlazeRod(Item::BLAZE_ROD, 0, "Blaze Rod"));
|
||||||
self::register(new Book());
|
self::register(new Book(Item::BOOK, 0, "Book"));
|
||||||
self::register(new Boots(Item::CHAIN_BOOTS, 0, "Chainmail Boots", new ArmorTypeInfo(1, 196)));
|
self::register(new Boots(Item::CHAIN_BOOTS, 0, "Chainmail Boots", new ArmorTypeInfo(1, 196)));
|
||||||
self::register(new Boots(Item::DIAMOND_BOOTS, 0, "Diamond Boots", new ArmorTypeInfo(3, 430)));
|
self::register(new Boots(Item::DIAMOND_BOOTS, 0, "Diamond Boots", new ArmorTypeInfo(3, 430)));
|
||||||
self::register(new Boots(Item::GOLDEN_BOOTS, 0, "Gold Boots", new ArmorTypeInfo(1, 92)));
|
self::register(new Boots(Item::GOLDEN_BOOTS, 0, "Gold Boots", new ArmorTypeInfo(1, 92)));
|
||||||
self::register(new Boots(Item::IRON_BOOTS, 0, "Iron Boots", new ArmorTypeInfo(2, 196)));
|
self::register(new Boots(Item::IRON_BOOTS, 0, "Iron Boots", new ArmorTypeInfo(2, 196)));
|
||||||
self::register(new Boots(Item::LEATHER_BOOTS, 0, "Leather Boots", new ArmorTypeInfo(1, 66)));
|
self::register(new Boots(Item::LEATHER_BOOTS, 0, "Leather Boots", new ArmorTypeInfo(1, 66)));
|
||||||
self::register(new Bow());
|
self::register(new Bow(Item::BOW, 0, "Bow"));
|
||||||
self::register(new Bowl());
|
self::register(new Bowl(Item::BOWL, 0, "Bowl"));
|
||||||
self::register(new Bread());
|
self::register(new Bread(Item::BREAD, 0, "Bread"));
|
||||||
self::register(new Bucket(Item::BUCKET, 0, "Bucket"));
|
self::register(new Bucket(Item::BUCKET, 0, "Bucket"));
|
||||||
self::register(new Carrot());
|
self::register(new Carrot(Item::CARROT, 0, "Carrot"));
|
||||||
self::register(new Chestplate(Item::CHAIN_CHESTPLATE, 0, "Chainmail Chestplate", new ArmorTypeInfo(5, 241)));
|
self::register(new Chestplate(Item::CHAIN_CHESTPLATE, 0, "Chainmail Chestplate", new ArmorTypeInfo(5, 241)));
|
||||||
self::register(new Chestplate(Item::DIAMOND_CHESTPLATE, 0, "Diamond Chestplate", new ArmorTypeInfo(8, 529)));
|
self::register(new Chestplate(Item::DIAMOND_CHESTPLATE, 0, "Diamond Chestplate", new ArmorTypeInfo(8, 529)));
|
||||||
self::register(new Chestplate(Item::GOLDEN_CHESTPLATE, 0, "Gold Chestplate", new ArmorTypeInfo(5, 113)));
|
self::register(new Chestplate(Item::GOLDEN_CHESTPLATE, 0, "Gold Chestplate", new ArmorTypeInfo(5, 113)));
|
||||||
self::register(new Chestplate(Item::IRON_CHESTPLATE, 0, "Iron Chestplate", new ArmorTypeInfo(6, 241)));
|
self::register(new Chestplate(Item::IRON_CHESTPLATE, 0, "Iron Chestplate", new ArmorTypeInfo(6, 241)));
|
||||||
self::register(new Chestplate(Item::LEATHER_CHESTPLATE, 0, "Leather Tunic", new ArmorTypeInfo(3, 81)));
|
self::register(new Chestplate(Item::LEATHER_CHESTPLATE, 0, "Leather Tunic", new ArmorTypeInfo(3, 81)));
|
||||||
self::register(new ChorusFruit());
|
self::register(new ChorusFruit(Item::CHORUS_FRUIT, 0, "Chorus Fruit"));
|
||||||
self::register(new Clock());
|
self::register(new Clock(Item::CLOCK, 0, "Clock"));
|
||||||
self::register(new Clownfish());
|
self::register(new Clownfish(Item::CLOWNFISH, 0, "Clownfish"));
|
||||||
self::register(new Coal(Item::COAL, 0, "Coal"));
|
self::register(new Coal(Item::COAL, 0, "Coal"));
|
||||||
self::register(new Coal(Item::COAL, 1, "Charcoal"));
|
self::register(new Coal(Item::COAL, 1, "Charcoal"));
|
||||||
self::register(new CocoaBeans(Item::DYE, 3, "Cocoa Beans"));
|
self::register(new CocoaBeans(Item::DYE, 3, "Cocoa Beans"));
|
||||||
self::register(new Compass());
|
self::register(new Compass(Item::COMPASS, 0, "Compass"));
|
||||||
self::register(new CookedChicken());
|
self::register(new CookedChicken(Item::COOKED_CHICKEN, 0, "Cooked Chicken"));
|
||||||
self::register(new CookedFish());
|
self::register(new CookedFish(Item::COOKED_FISH, 0, "Cooked Fish"));
|
||||||
self::register(new CookedMutton());
|
self::register(new CookedMutton(Item::COOKED_MUTTON, 0, "Cooked Mutton"));
|
||||||
self::register(new CookedPorkchop());
|
self::register(new CookedPorkchop(Item::COOKED_PORKCHOP, 0, "Cooked Porkchop"));
|
||||||
self::register(new CookedRabbit());
|
self::register(new CookedRabbit(Item::COOKED_RABBIT, 0, "Cooked Rabbit"));
|
||||||
self::register(new CookedSalmon());
|
self::register(new CookedSalmon(Item::COOKED_SALMON, 0, "Cooked Salmon"));
|
||||||
self::register(new Cookie());
|
self::register(new Cookie(Item::COOKIE, 0, "Cookie"));
|
||||||
self::register(new DriedKelp());
|
self::register(new DriedKelp(Item::DRIED_KELP, 0, "Dried Kelp"));
|
||||||
self::register(new Egg());
|
self::register(new Egg(Item::EGG, 0, "Egg"));
|
||||||
self::register(new EnderPearl());
|
self::register(new EnderPearl(Item::ENDER_PEARL, 0, "Ender Pearl"));
|
||||||
self::register(new ExperienceBottle());
|
self::register(new ExperienceBottle(Item::EXPERIENCE_BOTTLE, 0, "Bottle o' Enchanting"));
|
||||||
self::register(new Fertilizer(Item::DYE, 15, "Bone Meal"));
|
self::register(new Fertilizer(Item::DYE, 15, "Bone Meal"));
|
||||||
self::register(new FishingRod());
|
self::register(new FishingRod(Item::FISHING_ROD, 0, "Fishing Rod"));
|
||||||
self::register(new FlintSteel());
|
self::register(new FlintSteel(Item::FLINT_STEEL, 0, "Flint and Steel"));
|
||||||
self::register(new GlassBottle());
|
self::register(new GlassBottle(Item::GLASS_BOTTLE, 0, "Glass Bottle"));
|
||||||
self::register(new GoldenApple());
|
self::register(new GoldenApple(Item::GOLDEN_APPLE, 0, "Golden Apple"));
|
||||||
self::register(new GoldenAppleEnchanted());
|
self::register(new GoldenAppleEnchanted(Item::ENCHANTED_GOLDEN_APPLE, 0, "Enchanted Golden Apple"));
|
||||||
self::register(new GoldenCarrot());
|
self::register(new GoldenCarrot(Item::GOLDEN_CARROT, 0, "Golden Carrot"));
|
||||||
self::register(new Helmet(Item::CHAIN_HELMET, 0, "Chainmail Helmet", new ArmorTypeInfo(2, 166)));
|
self::register(new Helmet(Item::CHAIN_HELMET, 0, "Chainmail Helmet", new ArmorTypeInfo(2, 166)));
|
||||||
self::register(new Helmet(Item::DIAMOND_HELMET, 0, "Diamond Helmet", new ArmorTypeInfo(3, 364)));
|
self::register(new Helmet(Item::DIAMOND_HELMET, 0, "Diamond Helmet", new ArmorTypeInfo(3, 364)));
|
||||||
self::register(new Helmet(Item::GOLDEN_HELMET, 0, "Gold Helmet", new ArmorTypeInfo(2, 78)));
|
self::register(new Helmet(Item::GOLDEN_HELMET, 0, "Gold Helmet", new ArmorTypeInfo(2, 78)));
|
||||||
@ -220,33 +220,33 @@ class ItemFactory{
|
|||||||
//the meta values are intentionally hardcoded because block IDs will change in the future
|
//the meta values are intentionally hardcoded because block IDs will change in the future
|
||||||
self::register(new LiquidBucket(Item::BUCKET, 8, "Water Bucket", BlockLegacyIds::FLOWING_WATER));
|
self::register(new LiquidBucket(Item::BUCKET, 8, "Water Bucket", BlockLegacyIds::FLOWING_WATER));
|
||||||
self::register(new LiquidBucket(Item::BUCKET, 10, "Lava Bucket", BlockLegacyIds::FLOWING_LAVA));
|
self::register(new LiquidBucket(Item::BUCKET, 10, "Lava Bucket", BlockLegacyIds::FLOWING_LAVA));
|
||||||
self::register(new Melon());
|
self::register(new Melon(Item::MELON, 0, "Melon"));
|
||||||
self::register(new MelonSeeds());
|
self::register(new MelonSeeds(Item::MELON_SEEDS, 0, "Melon Seeds"));
|
||||||
self::register(new MilkBucket(Item::BUCKET, 1, "Milk Bucket"));
|
self::register(new MilkBucket(Item::BUCKET, 1, "Milk Bucket"));
|
||||||
self::register(new Minecart());
|
self::register(new Minecart(Item::MINECART, 0, "Minecart"));
|
||||||
self::register(new MushroomStew());
|
self::register(new MushroomStew(Item::MUSHROOM_STEW, 0, "Mushroom Stew"));
|
||||||
self::register(new PaintingItem());
|
self::register(new PaintingItem(Item::PAINTING, 0, "Painting"));
|
||||||
self::register(new Pickaxe(Item::DIAMOND_PICKAXE, "Diamond Pickaxe", TieredTool::TIER_DIAMOND));
|
self::register(new Pickaxe(Item::DIAMOND_PICKAXE, "Diamond Pickaxe", TieredTool::TIER_DIAMOND));
|
||||||
self::register(new Pickaxe(Item::GOLDEN_PICKAXE, "Gold Pickaxe", TieredTool::TIER_GOLD));
|
self::register(new Pickaxe(Item::GOLDEN_PICKAXE, "Gold Pickaxe", TieredTool::TIER_GOLD));
|
||||||
self::register(new Pickaxe(Item::IRON_PICKAXE, "Iron Pickaxe", TieredTool::TIER_IRON));
|
self::register(new Pickaxe(Item::IRON_PICKAXE, "Iron Pickaxe", TieredTool::TIER_IRON));
|
||||||
self::register(new Pickaxe(Item::STONE_PICKAXE, "Stone Pickaxe", TieredTool::TIER_STONE));
|
self::register(new Pickaxe(Item::STONE_PICKAXE, "Stone Pickaxe", TieredTool::TIER_STONE));
|
||||||
self::register(new Pickaxe(Item::WOODEN_PICKAXE, "Wooden Pickaxe", TieredTool::TIER_WOODEN));
|
self::register(new Pickaxe(Item::WOODEN_PICKAXE, "Wooden Pickaxe", TieredTool::TIER_WOODEN));
|
||||||
self::register(new PoisonousPotato());
|
self::register(new PoisonousPotato(Item::POISONOUS_POTATO, 0, "Poisonous Potato"));
|
||||||
self::register(new Potato());
|
self::register(new Potato(Item::POTATO, 0, "Potato"));
|
||||||
self::register(new Pufferfish());
|
self::register(new Pufferfish(Item::PUFFERFISH, 0, "Pufferfish"));
|
||||||
self::register(new PumpkinPie());
|
self::register(new PumpkinPie(Item::PUMPKIN_PIE, 0, "Pumpkin Pie"));
|
||||||
self::register(new PumpkinSeeds());
|
self::register(new PumpkinSeeds(Item::PUMPKIN_SEEDS, 0, "Pumpkin Seeds"));
|
||||||
self::register(new RabbitStew());
|
self::register(new RabbitStew(Item::RABBIT_STEW, 0, "Rabbit Stew"));
|
||||||
self::register(new RawBeef());
|
self::register(new RawBeef(Item::RAW_BEEF, 0, "Raw Beef"));
|
||||||
self::register(new RawChicken());
|
self::register(new RawChicken(Item::RAW_CHICKEN, 0, "Raw Chicken"));
|
||||||
self::register(new RawFish());
|
self::register(new RawFish(Item::RAW_FISH, 0, "Raw Fish"));
|
||||||
self::register(new RawMutton());
|
self::register(new RawMutton(Item::RAW_MUTTON, 0, "Raw Mutton"));
|
||||||
self::register(new RawPorkchop());
|
self::register(new RawPorkchop(Item::RAW_PORKCHOP, 0, "Raw Porkchop"));
|
||||||
self::register(new RawRabbit());
|
self::register(new RawRabbit(Item::RAW_RABBIT, 0, "Raw Rabbit"));
|
||||||
self::register(new RawSalmon());
|
self::register(new RawSalmon(Item::RAW_SALMON, 0, "Raw Salmon"));
|
||||||
self::register(new Redstone());
|
self::register(new Redstone(Item::REDSTONE, 0, "Redstone"));
|
||||||
self::register(new RottenFlesh());
|
self::register(new RottenFlesh(Item::ROTTEN_FLESH, 0, "Rotten Flesh"));
|
||||||
self::register(new Shears());
|
self::register(new Shears(Item::SHEARS, 0, "Shears"));
|
||||||
self::register(new Shovel(Item::DIAMOND_SHOVEL, "Diamond Shovel", TieredTool::TIER_DIAMOND));
|
self::register(new Shovel(Item::DIAMOND_SHOVEL, "Diamond Shovel", TieredTool::TIER_DIAMOND));
|
||||||
self::register(new Shovel(Item::GOLDEN_SHOVEL, "Gold Shovel", TieredTool::TIER_GOLD));
|
self::register(new Shovel(Item::GOLDEN_SHOVEL, "Gold Shovel", TieredTool::TIER_GOLD));
|
||||||
self::register(new Shovel(Item::IRON_SHOVEL, "Iron Shovel", TieredTool::TIER_IRON));
|
self::register(new Shovel(Item::IRON_SHOVEL, "Iron Shovel", TieredTool::TIER_IRON));
|
||||||
@ -258,20 +258,20 @@ class ItemFactory{
|
|||||||
self::register(new Sign(BlockLegacyIds::JUNGLE_STANDING_SIGN, 0, Item::JUNGLE_SIGN));
|
self::register(new Sign(BlockLegacyIds::JUNGLE_STANDING_SIGN, 0, Item::JUNGLE_SIGN));
|
||||||
self::register(new Sign(BlockLegacyIds::ACACIA_STANDING_SIGN, 0, Item::ACACIA_SIGN));
|
self::register(new Sign(BlockLegacyIds::ACACIA_STANDING_SIGN, 0, Item::ACACIA_SIGN));
|
||||||
self::register(new Sign(BlockLegacyIds::DARKOAK_STANDING_SIGN, 0, Item::DARKOAK_SIGN));
|
self::register(new Sign(BlockLegacyIds::DARKOAK_STANDING_SIGN, 0, Item::DARKOAK_SIGN));
|
||||||
self::register(new Snowball());
|
self::register(new Snowball(Item::SNOWBALL, 0, "Snowball"));
|
||||||
self::register(new SpiderEye());
|
self::register(new SpiderEye(Item::SPIDER_EYE, 0, "Spider Eye"));
|
||||||
self::register(new Steak());
|
self::register(new Steak(Item::STEAK, 0, "Steak"));
|
||||||
self::register(new Stick());
|
self::register(new Stick(Item::STICK, 0, "Stick"));
|
||||||
self::register(new StringItem());
|
self::register(new StringItem(Item::STRING, 0, "String"));
|
||||||
self::register(new Sword(Item::DIAMOND_SWORD, "Diamond Sword", TieredTool::TIER_DIAMOND));
|
self::register(new Sword(Item::DIAMOND_SWORD, "Diamond Sword", TieredTool::TIER_DIAMOND));
|
||||||
self::register(new Sword(Item::GOLDEN_SWORD, "Gold Sword", TieredTool::TIER_GOLD));
|
self::register(new Sword(Item::GOLDEN_SWORD, "Gold Sword", TieredTool::TIER_GOLD));
|
||||||
self::register(new Sword(Item::IRON_SWORD, "Iron Sword", TieredTool::TIER_IRON));
|
self::register(new Sword(Item::IRON_SWORD, "Iron Sword", TieredTool::TIER_IRON));
|
||||||
self::register(new Sword(Item::STONE_SWORD, "Stone Sword", TieredTool::TIER_STONE));
|
self::register(new Sword(Item::STONE_SWORD, "Stone Sword", TieredTool::TIER_STONE));
|
||||||
self::register(new Sword(Item::WOODEN_SWORD, "Wooden Sword", TieredTool::TIER_WOODEN));
|
self::register(new Sword(Item::WOODEN_SWORD, "Wooden Sword", TieredTool::TIER_WOODEN));
|
||||||
self::register(new Totem());
|
self::register(new Totem(Item::TOTEM, 0, "Totem of Undying"));
|
||||||
self::register(new WheatSeeds());
|
self::register(new WheatSeeds(Item::WHEAT_SEEDS, 0, "Wheat Seeds"));
|
||||||
self::register(new WritableBook());
|
self::register(new WritableBook(Item::WRITABLE_BOOK, 0, "Book & Quill"));
|
||||||
self::register(new WrittenBook());
|
self::register(new WrittenBook(Item::WRITTEN_BOOK, 0, "Written Book"));
|
||||||
|
|
||||||
foreach(SkullType::getAll() as $skullType){
|
foreach(SkullType::getAll() as $skullType){
|
||||||
self::register(new Skull(Item::SKULL, $skullType->getMagicNumber(), $skullType->getDisplayName(), $skullType));
|
self::register(new Skull(Item::SKULL, $skullType->getMagicNumber(), $skullType->getDisplayName(), $skullType));
|
||||||
@ -286,25 +286,25 @@ class ItemFactory{
|
|||||||
foreach(DyeColor::getAll() as $color){
|
foreach(DyeColor::getAll() as $color){
|
||||||
//TODO: use colour object directly
|
//TODO: use colour object directly
|
||||||
//TODO: add interface to dye-colour objects
|
//TODO: add interface to dye-colour objects
|
||||||
self::register(new Dye($dyeMap[$color] ?? $color->getInvertedMagicNumber(), $color->getDisplayName() . " Dye", $color));
|
self::register(new Dye(Item::DYE, $dyeMap[$color] ?? $color->getInvertedMagicNumber(), $color->getDisplayName() . " Dye", $color));
|
||||||
self::register(new Bed($color->getMagicNumber(), $color->getDisplayName() . " Bed", $color));
|
self::register(new Bed(Item::BED, $color->getMagicNumber(), $color->getDisplayName() . " Bed", $color));
|
||||||
self::register(new Banner($color->getInvertedMagicNumber(), $color->getDisplayName() . " Banner", $color));
|
self::register(new Banner(Item::BANNER, $color->getInvertedMagicNumber(), $color->getDisplayName() . " Banner", $color));
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(Potion::ALL as $type){
|
foreach(Potion::ALL as $type){
|
||||||
self::register(new Potion($type));
|
self::register(new Potion(Item::POTION, $type, "Potion"));
|
||||||
self::register(new SplashPotion($type));
|
self::register(new SplashPotion(Item::SPLASH_POTION, $type, "Splash Potion"));
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(EntityFactory::getKnownTypes() as $className){
|
foreach(EntityFactory::getKnownTypes() as $className){
|
||||||
/** @var Living|string $className */
|
/** @var Living|string $className */
|
||||||
if(is_a($className, Living::class, true) and $className::NETWORK_ID !== -1){
|
if(is_a($className, Living::class, true) and $className::NETWORK_ID !== -1){
|
||||||
self::register(new SpawnEgg(Item::SPAWN_EGG, $className::NETWORK_ID, $className, "Spawn Egg"));
|
self::register(new SpawnEgg(Item::SPAWN_EGG, $className::NETWORK_ID, "Spawn Egg", $className));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(TreeType::getAll() as $type){
|
foreach(TreeType::getAll() as $type){
|
||||||
self::register(new Boat($type));
|
self::register(new Boat(Item::BOAT, $type->getMagicNumber(), $type->getDisplayName() . " Boat", $type));
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: minecraft:acacia_sign
|
//TODO: minecraft:acacia_sign
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class Melon extends Food{
|
class Melon extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::MELON, 0, "Melon");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 2;
|
return 2;
|
||||||
|
@ -28,9 +28,6 @@ use pocketmine\block\BlockFactory;
|
|||||||
use pocketmine\block\BlockLegacyIds;
|
use pocketmine\block\BlockLegacyIds;
|
||||||
|
|
||||||
class MelonSeeds extends Item{
|
class MelonSeeds extends Item{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::MELON_SEEDS, 0, "Melon Seeds");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getBlock() : Block{
|
public function getBlock() : Block{
|
||||||
return BlockFactory::get(BlockLegacyIds::MELON_STEM);
|
return BlockFactory::get(BlockLegacyIds::MELON_STEM);
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class Minecart extends Item{
|
class Minecart extends Item{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::MINECART, 0, "Minecart");
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class MushroomStew extends Food{
|
class MushroomStew extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::MUSHROOM_STEW, 0, "Mushroom Stew");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxStackSize() : int{
|
public function getMaxStackSize() : int{
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -34,9 +34,6 @@ use pocketmine\Player;
|
|||||||
use function array_rand;
|
use function array_rand;
|
||||||
|
|
||||||
class PaintingItem extends Item{
|
class PaintingItem extends Item{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::PAINTING, 0, "Painting");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function onActivate(Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector) : ItemUseResult{
|
public function onActivate(Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector) : ItemUseResult{
|
||||||
if(Facing::axis($face) === Facing::AXIS_Y){
|
if(Facing::axis($face) === Facing::AXIS_Y){
|
||||||
|
@ -28,9 +28,6 @@ use pocketmine\entity\effect\EffectInstance;
|
|||||||
use function mt_rand;
|
use function mt_rand;
|
||||||
|
|
||||||
class PoisonousPotato extends Food{
|
class PoisonousPotato extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::POISONOUS_POTATO, 0, "Poisonous Potato");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 2;
|
return 2;
|
||||||
|
@ -28,9 +28,6 @@ use pocketmine\block\BlockFactory;
|
|||||||
use pocketmine\block\BlockLegacyIds;
|
use pocketmine\block\BlockLegacyIds;
|
||||||
|
|
||||||
class Potato extends Food{
|
class Potato extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::POTATO, 0, "Potato");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getBlock() : Block{
|
public function getBlock() : Block{
|
||||||
return BlockFactory::get(BlockLegacyIds::POTATO_BLOCK);
|
return BlockFactory::get(BlockLegacyIds::POTATO_BLOCK);
|
||||||
|
@ -255,10 +255,6 @@ class Potion extends Item implements Consumable{
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __construct(int $variant){
|
|
||||||
parent::__construct(self::POTION, $variant, "Potion");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxStackSize() : int{
|
public function getMaxStackSize() : int{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -27,9 +27,6 @@ use pocketmine\entity\effect\Effect;
|
|||||||
use pocketmine\entity\effect\EffectInstance;
|
use pocketmine\entity\effect\EffectInstance;
|
||||||
|
|
||||||
class Pufferfish extends Food{
|
class Pufferfish extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::PUFFERFISH, 0, "Pufferfish");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class PumpkinPie extends Food{
|
class PumpkinPie extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::PUMPKIN_PIE, 0, "Pumpkin Pie");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 8;
|
return 8;
|
||||||
|
@ -28,9 +28,6 @@ use pocketmine\block\BlockFactory;
|
|||||||
use pocketmine\block\BlockLegacyIds;
|
use pocketmine\block\BlockLegacyIds;
|
||||||
|
|
||||||
class PumpkinSeeds extends Item{
|
class PumpkinSeeds extends Item{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::PUMPKIN_SEEDS, 0, "Pumpkin Seeds");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getBlock() : Block{
|
public function getBlock() : Block{
|
||||||
return BlockFactory::get(BlockLegacyIds::PUMPKIN_STEM);
|
return BlockFactory::get(BlockLegacyIds::PUMPKIN_STEM);
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class RabbitStew extends Food{
|
class RabbitStew extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::RABBIT_STEW, 0, "Rabbit Stew");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxStackSize() : int{
|
public function getMaxStackSize() : int{
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class RawBeef extends Food{
|
class RawBeef extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::RAW_BEEF, 0, "Raw Beef");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 3;
|
return 3;
|
||||||
|
@ -28,9 +28,6 @@ use pocketmine\entity\effect\EffectInstance;
|
|||||||
use function mt_rand;
|
use function mt_rand;
|
||||||
|
|
||||||
class RawChicken extends Food{
|
class RawChicken extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::RAW_CHICKEN, 0, "Raw Chicken");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 2;
|
return 2;
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class RawFish extends Food{
|
class RawFish extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::RAW_FISH, 0, "Raw Fish");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 2;
|
return 2;
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class RawMutton extends Food{
|
class RawMutton extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::RAW_MUTTON, 0, "Raw Mutton");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 2;
|
return 2;
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class RawPorkchop extends Food{
|
class RawPorkchop extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::RAW_PORKCHOP, 0, "Raw Porkchop");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 3;
|
return 3;
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class RawRabbit extends Food{
|
class RawRabbit extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::RAW_RABBIT, 0, "Raw Rabbit");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 3;
|
return 3;
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class RawSalmon extends Food{
|
class RawSalmon extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::RAW_SALMON, 0, "Raw Salmon");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 2;
|
return 2;
|
||||||
|
@ -28,9 +28,6 @@ use pocketmine\block\BlockFactory;
|
|||||||
use pocketmine\block\BlockLegacyIds;
|
use pocketmine\block\BlockLegacyIds;
|
||||||
|
|
||||||
class Redstone extends Item{
|
class Redstone extends Item{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::REDSTONE, 0, "Redstone");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getBlock() : Block{
|
public function getBlock() : Block{
|
||||||
return BlockFactory::get(BlockLegacyIds::REDSTONE_WIRE);
|
return BlockFactory::get(BlockLegacyIds::REDSTONE_WIRE);
|
||||||
|
@ -29,10 +29,6 @@ use function lcg_value;
|
|||||||
|
|
||||||
class RottenFlesh extends Food{
|
class RottenFlesh extends Food{
|
||||||
|
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::ROTTEN_FLESH, 0, "Rotten Flesh");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
@ -27,9 +27,6 @@ use pocketmine\block\Block;
|
|||||||
use pocketmine\block\BlockToolType;
|
use pocketmine\block\BlockToolType;
|
||||||
|
|
||||||
class Shears extends Tool{
|
class Shears extends Tool{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::SHEARS, 0, "Shears");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxDurability() : int{
|
public function getMaxDurability() : int{
|
||||||
return 239;
|
return 239;
|
||||||
|
@ -26,9 +26,6 @@ namespace pocketmine\item;
|
|||||||
use pocketmine\entity\projectile\Snowball as SnowballEntity;
|
use pocketmine\entity\projectile\Snowball as SnowballEntity;
|
||||||
|
|
||||||
class Snowball extends ProjectileItem{
|
class Snowball extends ProjectileItem{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::SNOWBALL, 0, "Snowball");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxStackSize() : int{
|
public function getMaxStackSize() : int{
|
||||||
return 16;
|
return 16;
|
||||||
|
@ -39,12 +39,13 @@ class SpawnEgg extends Item{
|
|||||||
/**
|
/**
|
||||||
* @param int $id
|
* @param int $id
|
||||||
* @param int $variant
|
* @param int $variant
|
||||||
* @param string $entityClass instanceof Entity
|
|
||||||
* @param string $name
|
* @param string $name
|
||||||
*
|
*
|
||||||
|
* @param string $entityClass instanceof Entity
|
||||||
|
*
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function __construct(int $id, int $variant, string $entityClass, string $name = "Unknown"){
|
public function __construct(int $id, int $variant, string $name, string $entityClass){
|
||||||
parent::__construct($id, $variant, $name);
|
parent::__construct($id, $variant, $name);
|
||||||
Utils::testValidInstance($entityClass, Entity::class);
|
Utils::testValidInstance($entityClass, Entity::class);
|
||||||
$this->entityClass = $entityClass;
|
$this->entityClass = $entityClass;
|
||||||
|
@ -27,9 +27,6 @@ use pocketmine\entity\effect\Effect;
|
|||||||
use pocketmine\entity\effect\EffectInstance;
|
use pocketmine\entity\effect\EffectInstance;
|
||||||
|
|
||||||
class SpiderEye extends Food{
|
class SpiderEye extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::SPIDER_EYE, 0, "Spider Eye");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 2;
|
return 2;
|
||||||
|
@ -28,10 +28,6 @@ use pocketmine\nbt\tag\CompoundTag;
|
|||||||
|
|
||||||
class SplashPotion extends ProjectileItem{
|
class SplashPotion extends ProjectileItem{
|
||||||
|
|
||||||
public function __construct(int $variant){
|
|
||||||
parent::__construct(self::SPLASH_POTION, $variant, "Splash Potion");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxStackSize() : int{
|
public function getMaxStackSize() : int{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class Steak extends Food{
|
class Steak extends Food{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::STEAK, 0, "Steak");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFoodRestore() : int{
|
public function getFoodRestore() : int{
|
||||||
return 8;
|
return 8;
|
||||||
|
@ -25,9 +25,6 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
|
|
||||||
class Stick extends Item{
|
class Stick extends Item{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::STICK, 0, "Stick");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFuelTime() : int{
|
public function getFuelTime() : int{
|
||||||
return 100;
|
return 100;
|
||||||
|
@ -28,9 +28,6 @@ use pocketmine\block\BlockFactory;
|
|||||||
use pocketmine\block\BlockLegacyIds;
|
use pocketmine\block\BlockLegacyIds;
|
||||||
|
|
||||||
class StringItem extends Item{
|
class StringItem extends Item{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::STRING, 0, "String");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getBlock() : Block{
|
public function getBlock() : Block{
|
||||||
return BlockFactory::get(BlockLegacyIds::TRIPWIRE);
|
return BlockFactory::get(BlockLegacyIds::TRIPWIRE);
|
||||||
|
@ -24,9 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\item;
|
namespace pocketmine\item;
|
||||||
|
|
||||||
class Totem extends Item{
|
class Totem extends Item{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::TOTEM, 0, "Totem of Undying");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxStackSize() : int{
|
public function getMaxStackSize() : int{
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -28,9 +28,6 @@ use pocketmine\block\BlockFactory;
|
|||||||
use pocketmine\block\BlockLegacyIds;
|
use pocketmine\block\BlockLegacyIds;
|
||||||
|
|
||||||
class WheatSeeds extends Item{
|
class WheatSeeds extends Item{
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::WHEAT_SEEDS, 0, "Wheat Seeds");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getBlock() : Block{
|
public function getBlock() : Block{
|
||||||
return BlockFactory::get(BlockLegacyIds::WHEAT_BLOCK);
|
return BlockFactory::get(BlockLegacyIds::WHEAT_BLOCK);
|
||||||
|
@ -25,7 +25,4 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class WritableBook extends WritableBookBase{
|
class WritableBook extends WritableBookBase{
|
||||||
|
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::WRITABLE_BOOK, 0, "Book & Quill");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -34,10 +34,6 @@ class WrittenBook extends WritableBookBase{
|
|||||||
public const TAG_AUTHOR = "author"; //TAG_String
|
public const TAG_AUTHOR = "author"; //TAG_String
|
||||||
public const TAG_TITLE = "title"; //TAG_String
|
public const TAG_TITLE = "title"; //TAG_String
|
||||||
|
|
||||||
public function __construct(){
|
|
||||||
parent::__construct(self::WRITTEN_BOOK, 0, "Written Book");
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxStackSize() : int{
|
public function getMaxStackSize() : int{
|
||||||
return 16;
|
return 16;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user