diff --git a/src/block/BlockTypeTags.php b/src/block/BlockTypeTags.php index 8537a2814..19a4825d9 100644 --- a/src/block/BlockTypeTags.php +++ b/src/block/BlockTypeTags.php @@ -30,4 +30,5 @@ final class BlockTypeTags{ public const MUD = self::PREFIX . "mud"; public const SAND = self::PREFIX . "sand"; public const POTTABLE_PLANTS = self::PREFIX . "pottable"; + public const FIRE = self::PREFIX . "fire"; } diff --git a/src/block/VanillaBlocks.php b/src/block/VanillaBlocks.php index a4e70031b..277cac26c 100644 --- a/src/block/VanillaBlocks.php +++ b/src/block/VanillaBlocks.php @@ -829,7 +829,7 @@ final class VanillaBlocks{ self::register("ender_chest", new EnderChest(new BID(Ids::ENDER_CHEST, TileEnderChest::class), "Ender Chest", new Info(BreakInfo::pickaxe(22.5, ToolTier::WOOD(), 3000.0)))); self::register("farmland", new Farmland(new BID(Ids::FARMLAND), "Farmland", new Info(BreakInfo::shovel(0.6), [Tags::DIRT]))); - self::register("fire", new Fire(new BID(Ids::FIRE), "Fire Block", new Info(BreakInfo::instant()))); + self::register("fire", new Fire(new BID(Ids::FIRE), "Fire Block", new Info(BreakInfo::instant(), [Tags::FIRE]))); self::register("fletching_table", new FletchingTable(new BID(Ids::FLETCHING_TABLE), "Fletching Table", new Info(BreakInfo::axe(2.5, null, 2.5)))); $flowerTypeInfo = new Info(BreakInfo::instant(), [Tags::POTTABLE_PLANTS]); @@ -1457,7 +1457,7 @@ final class VanillaBlocks{ self::register("cracked_polished_blackstone_bricks", new Opaque(new BID(Ids::CRACKED_POLISHED_BLACKSTONE_BRICKS), "Cracked Polished Blackstone Bricks", $blackstoneBreakInfo)); self::register("soul_torch", new Torch(new BID(Ids::SOUL_TORCH), "Soul Torch", new Info(BreakInfo::instant()))); - self::register("soul_fire", new SoulFire(new BID(Ids::SOUL_FIRE), "Soul Fire", new Info(BreakInfo::instant()))); + self::register("soul_fire", new SoulFire(new BID(Ids::SOUL_FIRE), "Soul Fire", new Info(BreakInfo::instant(), [Tags::FIRE]))); //TODO: soul soul ought to have 0.5 hardness (as per java) but it's 1.0 in Bedrock (probably parity bug) self::register("soul_soil", new Opaque(new BID(Ids::SOUL_SOIL), "Soul Soil", new Info(BreakInfo::shovel(1.0)))); diff --git a/src/entity/projectile/SplashPotion.php b/src/entity/projectile/SplashPotion.php index 3f6eeff7e..4f4e3de97 100644 --- a/src/entity/projectile/SplashPotion.php +++ b/src/entity/projectile/SplashPotion.php @@ -23,7 +23,7 @@ declare(strict_types=1); namespace pocketmine\entity\projectile; -use pocketmine\block\BlockTypeIds; +use pocketmine\block\BlockTypeTags; use pocketmine\block\VanillaBlocks; use pocketmine\color\Color; use pocketmine\data\bedrock\PotionTypeIdMap; @@ -130,11 +130,11 @@ class SplashPotion extends Throwable{ }elseif($event instanceof ProjectileHitBlockEvent && $this->getPotionType()->equals(PotionType::WATER())){ $blockIn = $event->getBlockHit()->getSide($event->getRayTraceResult()->getHitFace()); - if($blockIn->getTypeId() === BlockTypeIds::FIRE){ + if($blockIn->hasTypeTag(BlockTypeTags::FIRE)){ $this->getWorld()->setBlock($blockIn->getPosition(), VanillaBlocks::AIR()); } foreach($blockIn->getHorizontalSides() as $horizontalSide){ - if($horizontalSide->getTypeId() === BlockTypeIds::FIRE){ + if($horizontalSide->hasTypeTag(BlockTypeTags::FIRE)){ $this->getWorld()->setBlock($horizontalSide->getPosition(), VanillaBlocks::AIR()); } } diff --git a/src/player/Player.php b/src/player/Player.php index 6025710d9..5b352acf7 100644 --- a/src/player/Player.php +++ b/src/player/Player.php @@ -24,7 +24,7 @@ declare(strict_types=1); namespace pocketmine\player; use pocketmine\block\Bed; -use pocketmine\block\BlockTypeIds; +use pocketmine\block\BlockTypeTags; use pocketmine\block\UnknownBlock; use pocketmine\block\VanillaBlocks; use pocketmine\command\CommandSender; @@ -1684,7 +1684,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{ } $block = $target->getSide($face); - if($block->getTypeId() === BlockTypeIds::FIRE || $block->getTypeId() === BlockTypeIds::SOUL_FIRE){ + if($block->hasTypeTag(BlockTypeTags::FIRE)){ $this->getWorld()->setBlock($block->getPosition(), VanillaBlocks::AIR()); $this->getWorld()->addSound($block->getPosition()->add(0.5, 0.5, 0.5), new FireExtinguishSound()); return true;