22declare(strict_types=1);
24namespace pocketmine\block\utils;
42 public function getLightLevel() : int{
43 return $this->lit ? 3 : 0;
47 public function onInteract(Item $item,
int $face, Vector3 $clickVector, ?Player $player =
null, array &$returnedItems = []) : bool{
48 if($item->getTypeId() === ItemTypeIds::FIRE_CHARGE || $item->getTypeId() === ItemTypeIds::FLINT_AND_STEEL || $item->hasEnchantment(VanillaEnchantments::FIRE_ASPECT())){
52 if($item instanceof Durable){
53 $item->applyDamage(1);
54 }elseif($item->getTypeId() === ItemTypeIds::FIRE_CHARGE){
57 $this->position->getWorld()->addSound($this->position,
new BlazeShootSound());
59 $this->position->getWorld()->addSound($this->position,
new FlintSteelSound());
60 $this->position->getWorld()->setBlock($this->position, $this->setLit(
true));
68 $this->position->getWorld()->addSound($this->position,
new FireExtinguishSound());
69 $this->position->getWorld()->setBlock($this->position, $this->setLit(
false));
79 public function onProjectileHit(Projectile $projectile, RayTraceResult $hitResult) : void{
80 if(!$this->lit && $projectile->isOnFire()){
81 $this->position->getWorld()->setBlock($this->position, $this->setLit(
true));