本文整理匯總了PHP中pocketmine\item\Item::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP Item::__construct方法的具體用法?PHP Item::__construct怎麽用?PHP Item::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pocketmine\item\Item
的用法示例。
在下文中一共展示了Item::__construct方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* @param int $id
* @param int $meta
* @param int $count
* @param string $name
* @param int|float $perAmount
* @param int $maxStack
* @param bool $throwable
*/
public function __construct($id, $meta = 0, $count = 1, $name, $perAmount, $maxStack, $throwable = true)
{
parent::__construct($id, $meta, $count, $name);
$this->perAmount = $perAmount;
$this->isActivable = $throwable;
$this->maxStackSize = $maxStack;
}
示例2: __construct
public function __construct($meta = 0, $count = 1)
{
if ($meta == 3) {
$this->block = Block::get(CropPlus::COCOA_BEANS_BLOCK);
}
parent::__construct(Item::DYE, $meta, $count, "Dye");
}
示例3: __construct
public function __construct($meta = 0, $count = 1)
{
if ($meta === self::COCOA_BEANS) {
$this->block = Block::get(Item::COCOA_POD);
$this->meta = 1;
}
parent::__construct(self::DYE, $meta, $count, $this->getNameByMeta($meta));
}
示例4: __construct
public function __construct($meta = 0, $count = 1)
{
if ($meta === 3) {
$this->block = Block::get(Item::COCOA_BLOCK);
parent::__construct(self::DYE, 3, $count, "Cocoa Beans");
} else {
parent::__construct(self::DYE, $meta, $count, $this->getNameByMeta($meta));
}
}
示例5: __construct
public function __construct($meta = 0, $count = 1)
{
parent::__construct(self::BOAT, $meta, $count, "Oak Boat");
if ($this->meta === 1) {
$this->name = "Spruce Boat";
} elseif ($this->meta === 2) {
$this->name = "Birch Boat";
} elseif ($this->meta === 3) {
$this->name = "Jungle Boat";
} elseif ($this->meta === 4) {
$this->name = "Acacia Boat";
} elseif ($this->meta === 5) {
$this->name = "Dark Oak Boat";
}
}
示例6: __construct
public function __construct($meta = 0, $count = 1)
{
$this->block = Block::get(Item::DARK_OAK_DOOR);
parent::__construct(self::DARK_OAK_DOOR, 0, $count, "Dark Oak Door");
}
示例7: __construct
public function __construct($meta = 0, $count = 1)
{
parent::__construct(self::SPAWN_EGG, $meta, $count, "Spawn Egg");
}
示例8: __construct
public function __construct($meta = 0, $count = 1)
{
parent::__construct(self::POTION, $meta, $count, $this->getNameByMeta($meta));
}
示例9: __construct
public function __construct($meta = 0, $count = 1)
{
parent::__construct(self::DARK_OAK_DOOR, $meta, $count, "Dark Oak Door");
$this->block = Block::get(Block::DARK_OAK_DOOR_BLOCK, $meta);
}
示例10: __construct
public function __construct($meta = 0, $count = 1)
{
$this->block = Block::get(Item::SIGN_POST);
parent::__construct(self::SIGN, 0, $count, "Sign");
}
示例11: __construct
public function __construct($meta = 0, $count = 1)
{
parent::__construct(self::REDSTONE, $meta, $count, "Redstone");
}
示例12: __construct
public function __construct($meta = 0, $count = 1)
{
parent::__construct(self::MINECART, $meta, $count, "Minecart");
}
示例13: __construct
public function __construct($meta = 0, $count = 1)
{
$this->block = Block::get(Item::MELON_STEM);
parent::__construct(self::MELON_SEEDS, 0, $count, "Melon Seeds");
}
示例14: __construct
public function __construct($meta = 0, $count = 1)
{
$this->block = Block::get(Block::CAULDRON_BLOCK);
parent::__construct(self::CAULDRON, $meta, $count, "Cauldron");
}
示例15: __construct
public function __construct($meta = 0, $count = 1)
{
$this->block = Block::get(Item::ITEM_FRAME_BLOCK);
parent::__construct(self::ITEM_FRAME, 0, $count, "Item Frame");
}