mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 11:57:10 +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(){
|
public function __construct(){
|
||||||
parent::__construct(GLOWSTONE_BLOCK, 0, "Glowstone");
|
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){
|
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);
|
$level->setBlock($block, new FireBlock(), true, false, true);
|
||||||
$block->level->scheduleBlockUpdate(new Position($block, 0, 0, $block->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM);
|
$block->level->scheduleBlockUpdate(new Position($block, 0, 0, $block->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM);
|
||||||
return true;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user