Fixed flint&steel usage

This commit is contained in:
Shoghi Cervantes 2013-08-27 19:15:18 +02:00
parent 4cdb751a67
commit 9d52250afa
2 changed files with 6 additions and 5 deletions

View File

@ -19,7 +19,7 @@
*
*/
class GlowstoneBlock extends SolidBlock{
class GlowstoneBlock extends TransparentBlock{
public function __construct(){
parent::__construct(GLOWSTONE_BLOCK, 0, "Glowstone");
}

View File

@ -27,14 +27,15 @@ class FlintSteelItem extends Item{
}
public function onActivate(Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
if($block->getID() === AIR){
if($this->useOn($block) and ($player->gamemode & 0x01) === 0 and $this->getMetadata() >= $this->getMaxDurability()){
$player->setSlot($player->slot, new Item(AIR, 0, 0), false);
}
if($block->getID() === AIR and ($target instanceof SolidBlock)){
$level->setBlock($block, new FireBlock(), true, false, true);
$block->level->scheduleBlockUpdate(new Position($block, 0, 0, $block->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM);
return true;
}
if($this->useOn($block) and ($player->gamemode & 0x01) === 0 and $this->getMetadata() >= $this->getMaxDurability()){
$player->setSlot($player->slot, new Item(AIR, 0, 0), false);
}
return false;
}
}