mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 09:19:42 +00:00
Fixed #1213
This commit is contained in:
parent
77e914238c
commit
169c55443a
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class DiamondAxe extends Tool{
|
class DiamondAxe extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::DIAMOND_AXE, 0, $count, "Diamond Axe");
|
parent::__construct(self::DIAMOND_AXE, $meta, $count, "Diamond Axe");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class DiamondHoe extends Tool{
|
class DiamondHoe extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::DIAMOND_HOE, 0, $count, "Diamond Hoe");
|
parent::__construct(self::DIAMOND_HOE, $meta, $count, "Diamond Hoe");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class DiamondPickaxe extends Tool{
|
class DiamondPickaxe extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::DIAMOND_PICKAXE, 0, $count, "Diamond Pickaxe");
|
parent::__construct(self::DIAMOND_PICKAXE, $meta, $count, "Diamond Pickaxe");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class DiamondShovel extends Tool{
|
class DiamondShovel extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::DIAMOND_SHOVEL, 0, $count, "Diamond Shovel");
|
parent::__construct(self::DIAMOND_SHOVEL, $meta, $count, "Diamond Shovel");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class DiamondSword extends Tool{
|
class DiamondSword extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::DIAMOND_SWORD, 0, $count, "Diamond Sword");
|
parent::__construct(self::DIAMOND_SWORD, $meta, $count, "Diamond Sword");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ class FlintSteel extends Tool{
|
|||||||
|
|
||||||
public function onActivate(Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
public function onActivate(Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||||
if(($player->gamemode & 0x01) === 0 and $this->useOn($block) and $this->getDamage() >= $this->getMaxDurability()){
|
if(($player->gamemode & 0x01) === 0 and $this->useOn($block) and $this->getDamage() >= $this->getMaxDurability()){
|
||||||
$player->setSlot($player->getCurrentEquipment(), new Item(Item::AIR, 0, 0));
|
$player->getInventory()->setItemInHand(new Item(Item::AIR, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if($block->getID() === self::AIR and ($target instanceof Solid)){
|
if($block->getID() === self::AIR and ($target instanceof Solid)){
|
||||||
|
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class GoldAxe extends Tool{
|
class GoldAxe extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::GOLD_AXE, 0, $count, "Gold Axe");
|
parent::__construct(self::GOLD_AXE, $meta, $count, "Gold Axe");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class GoldHoe extends Tool{
|
class GoldHoe extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::GOLD_HOE, 0, $count, "Gold Hoe");
|
parent::__construct(self::GOLD_HOE, $meta, $count, "Gold Hoe");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class GoldPickaxe extends Tool{
|
class GoldPickaxe extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::GOLD_PICKAXE, 0, $count, "Gold Pickaxe");
|
parent::__construct(self::GOLD_PICKAXE, $meta, $count, "Gold Pickaxe");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class GoldShovel extends Tool{
|
class GoldShovel extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::GOLD_SHOVEL, 0, $count, "Gold Shovel");
|
parent::__construct(self::GOLD_SHOVEL, $meta, $count, "Gold Shovel");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class GoldSword extends Tool{
|
class GoldSword extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::GOLD_SWORD, 0, $count, "Gold Sword");
|
parent::__construct(self::GOLD_SWORD, $meta, $count, "Gold Sword");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class IronAxe extends Tool{
|
class IronAxe extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::IRON_AXE, 0, $count, "Iron Axe");
|
parent::__construct(self::IRON_AXE, $meta, $count, "Iron Axe");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class IronHoe extends Tool{
|
class IronHoe extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::IRON_HOE, 0, $count, "Iron Hoe");
|
parent::__construct(self::IRON_HOE, $meta, $count, "Iron Hoe");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class IronPickaxe extends Tool{
|
class IronPickaxe extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::IRON_PICKAXE, 0, $count, "Iron Pickaxe");
|
parent::__construct(self::IRON_PICKAXE, $meta, $count, "Iron Pickaxe");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class IronShovel extends Tool{
|
class IronShovel extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::IRON_SHOVEL, 0, $count, "Iron Shovel");
|
parent::__construct(self::IRON_SHOVEL, $meta, $count, "Iron Shovel");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
30
src/pocketmine/item/IronSword.php
Normal file
30
src/pocketmine/item/IronSword.php
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* @author PocketMine Team
|
||||||
|
* @link http://www.pocketmine.net/
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace pocketmine\item;
|
||||||
|
|
||||||
|
|
||||||
|
class IronSword extends Tool{
|
||||||
|
public function __construct($meta = 0, $count = 1){
|
||||||
|
parent::__construct(self::IRON_SWORD, $meta, $count, "Iron Sword");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -412,6 +412,7 @@ class Item{
|
|||||||
self::BOWL => new Bowl(),
|
self::BOWL => new Bowl(),
|
||||||
self::FEATHER => new Feather(),
|
self::FEATHER => new Feather(),
|
||||||
self::BRICK => new Brick(),
|
self::BRICK => new Brick(),
|
||||||
|
self::IRON_SWORD => new IronSword(),
|
||||||
self::IRON_INGOT => new IronIngot(),
|
self::IRON_INGOT => new IronIngot(),
|
||||||
self::GOLD_INGOT => new GoldIngot(),
|
self::GOLD_INGOT => new GoldIngot(),
|
||||||
self::IRON_SHOVEL => new IronShovel(),
|
self::IRON_SHOVEL => new IronShovel(),
|
||||||
|
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class StoneAxe extends Tool{
|
class StoneAxe extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::STONE_AXE, 0, $count, "Stone Axe");
|
parent::__construct(self::STONE_AXE, $meta, $count, "Stone Axe");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class StoneHoe extends Tool{
|
class StoneHoe extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::STONE_HOE, 0, $count, "Stone Hoe");
|
parent::__construct(self::STONE_HOE, $meta, $count, "Stone Hoe");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class StonePickaxe extends Tool{
|
class StonePickaxe extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::STONE_PICKAXE, 0, $count, "Stone Pickaxe");
|
parent::__construct(self::STONE_PICKAXE, $meta, $count, "Stone Pickaxe");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class StoneShovel extends Tool{
|
class StoneShovel extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::STONE_SHOVEL, 0, $count, "Stone Shovel");
|
parent::__construct(self::STONE_SHOVEL, $meta, $count, "Stone Shovel");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class StoneSword extends Tool{
|
class StoneSword extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::STONE_SWORD, 0, $count, "Stone Sword");
|
parent::__construct(self::STONE_SWORD, $meta, $count, "Stone Sword");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class WoodenAxe extends Tool{
|
class WoodenAxe extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::WOODEN_AXE, 0, $count, "Wooden Axe");
|
parent::__construct(self::WOODEN_AXE, $meta, $count, "Wooden Axe");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class WoodenHoe extends Tool{
|
class WoodenHoe extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::WOODEN_HOE, 0, $count, "Wooden Hoe");
|
parent::__construct(self::WOODEN_HOE, $meta, $count, "Wooden Hoe");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class WoodenPickaxe extends Tool{
|
class WoodenPickaxe extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::WOODEN_PICKAXE, 0, $count, "Wooden Pickaxe");
|
parent::__construct(self::WOODEN_PICKAXE, $meta, $count, "Wooden Pickaxe");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class WoodenShovel extends Tool{
|
class WoodenShovel extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::WOODEN_SHOVEL, 0, $count, "Wooden Shovel");
|
parent::__construct(self::WOODEN_SHOVEL, $meta, $count, "Wooden Shovel");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
class WoodenSword extends Tool{
|
class WoodenSword extends Tool{
|
||||||
public function __construct($meta = 0, $count = 1){
|
public function __construct($meta = 0, $count = 1){
|
||||||
parent::__construct(self::WOODEN_SWORD, 0, $count, "Wooden Sword");
|
parent::__construct(self::WOODEN_SWORD, $meta, $count, "Wooden Sword");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user