mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Move block registration to its own class
This commit is contained in:
@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
namespace pocketmine\item;
|
||||
|
||||
use pocketmine\block\Block;
|
||||
use pocketmine\block\BlockFactory;
|
||||
use pocketmine\block\Fire;
|
||||
use pocketmine\block\Solid;
|
||||
use pocketmine\level\Level;
|
||||
@ -37,7 +38,7 @@ class FlintSteel extends Tool{
|
||||
|
||||
public function onActivate(Level $level, Player $player, Block $block, Block $target, int $face, Vector3 $facePos) : bool{
|
||||
if($block->getId() === self::AIR and ($target instanceof Solid)){
|
||||
$level->setBlock($block, Block::get(Block::FIRE), true);
|
||||
$level->setBlock($block, BlockFactory::get(Block::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));
|
||||
|
Reference in New Issue
Block a user