mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-05 03:17:12 +00:00
Fixed flint&steel usage
This commit is contained in:
parent
4cdb751a67
commit
9d52250afa
@ -19,7 +19,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
class GlowstoneBlock extends SolidBlock{
|
||||
class GlowstoneBlock extends TransparentBlock{
|
||||
public function __construct(){
|
||||
parent::__construct(GLOWSTONE_BLOCK, 0, "Glowstone");
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user