mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 13:09:44 +00:00
Fixed flint&steel usage
This commit is contained in:
parent
4cdb751a67
commit
9d52250afa
2 changed files with 6 additions and 5 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue