mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-08-31 07:21:17 +00:00
parent
6ea7fd7d6b
commit
4bdd6410db
@ -24,6 +24,7 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\BlockDataSerializer;
|
use pocketmine\block\utils\BlockDataSerializer;
|
||||||
|
use pocketmine\block\utils\SupportType;
|
||||||
use pocketmine\entity\Entity;
|
use pocketmine\entity\Entity;
|
||||||
use pocketmine\entity\projectile\Arrow;
|
use pocketmine\entity\projectile\Arrow;
|
||||||
use pocketmine\event\block\BlockBurnEvent;
|
use pocketmine\event\block\BlockBurnEvent;
|
||||||
@ -99,9 +100,13 @@ class Fire extends Flowable{
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function canBeSupportedBy(Block $block) : bool{
|
||||||
|
return $block->getSupportType(Facing::UP)->equals(SupportType::FULL());
|
||||||
|
}
|
||||||
|
|
||||||
public function onNearbyBlockChange() : void{
|
public function onNearbyBlockChange() : void{
|
||||||
$world = $this->position->getWorld();
|
$world = $this->position->getWorld();
|
||||||
if($this->getSide(Facing::DOWN)->isTransparent() && !$this->hasAdjacentFlammableBlocks()){
|
if(!$this->canBeSupportedBy($this->getSide(Facing::DOWN)) && !$this->hasAdjacentFlammableBlocks()){
|
||||||
$world->setBlock($this->position, VanillaBlocks::AIR());
|
$world->setBlock($this->position, VanillaBlocks::AIR());
|
||||||
}else{
|
}else{
|
||||||
$world->scheduleDelayedBlockUpdate($this->position, mt_rand(30, 40));
|
$world->scheduleDelayedBlockUpdate($this->position, mt_rand(30, 40));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user