mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Improved Item property handling
This commit is contained in:
@ -30,9 +30,12 @@ use pocketmine\Player;
|
||||
class FlintSteel extends Tool{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(self::FLINT_STEEL, $meta, $count, "Flint and Steel");
|
||||
$this->isActivable = true;
|
||||
}
|
||||
|
||||
public function canBeActivated(){
|
||||
return true;
|
||||
}
|
||||
|
||||
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()){
|
||||
$player->getInventory()->setItemInHand(new Item(Item::AIR, 0, 0));
|
||||
|
Reference in New Issue
Block a user