This commit is contained in:
PEMapModder 2016-02-22 16:26:35 +08:00
parent 6945256e30
commit 17c73e9764

View File

@ -37,12 +37,16 @@ class FlintSteel extends Tool{
}
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));
}
if($block->getId() === self::AIR and ($target instanceof Solid)){
$level->setBlock($block, new Fire(), true);
if(($player->gamemode & 0x01) === 0 and $this->useOn($block)){
if($this->getDamage() >= $this->getMaxDurability()){
$player->getInventory()->setItemInHand(new Item(Item::AIR, 0, 0));
}else{
$this->meta++;
$player->getInventory()->setItemInHand($this);
}
}
return true;
}