22declare(strict_types=1);
24namespace pocketmine\block\utils;
43 public function getLightLevel() : int{
44 return $this->lit ? 3 : 0;
52 public function onInteract(Item $item,
Facing $face, Vector3 $clickVector, ?Player $player =
null, array &$returnedItems = []) : bool{
53 if($item->getTypeId() === ItemTypeIds::FIRE_CHARGE || $item->getTypeId() === ItemTypeIds::FLINT_AND_STEEL || $item->hasEnchantment(VanillaEnchantments::FIRE_ASPECT())){
57 if($item instanceof Durable){
58 $item->applyDamage(1);
59 }elseif($item->getTypeId() === ItemTypeIds::FIRE_CHARGE){
62 $this->position->getWorld()->addSound($this->position,
new BlazeShootSound());
64 $this->position->getWorld()->addSound($this->position,
new FlintSteelSound());
65 $this->position->getWorld()->setBlock($this->position, $this->setLit(
true));
73 $this->position->getWorld()->addSound($this->position,
new FireExtinguishSound());
74 $this->position->getWorld()->setBlock($this->position, $this->setLit(
false));
84 public function onProjectileHit(Projectile $projectile, RayTraceResult $hitResult) : void{
85 if(!$this->lit && $projectile->isOnFire()){
86 $this->position->getWorld()->setBlock($this->position, $this->setLit(
true));