Added tag for fire blocks

This commit is contained in:
Dylan K. Taylor 2022-12-19 15:22:09 +00:00
parent 0efd928db6
commit f38b15cf83
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
4 changed files with 8 additions and 7 deletions

View File

@ -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";
}

View File

@ -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))));

View File

@ -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());
}
}

View File

@ -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;