mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 11:57:10 +00:00
Added tag for fire blocks
This commit is contained in:
parent
0efd928db6
commit
f38b15cf83
@ -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";
|
||||
}
|
||||
|
@ -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))));
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user