mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Fix missing sound when a projectile strikes an amethyst block (#5382)
closes #5358
This commit is contained in:
@ -55,9 +55,13 @@ use pocketmine\block\tile\Skull as TileSkull;
|
||||
use pocketmine\block\tile\Smoker as TileSmoker;
|
||||
use pocketmine\block\utils\TreeType;
|
||||
use pocketmine\block\utils\WoodType;
|
||||
use pocketmine\entity\projectile\Projectile;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\item\ToolTier;
|
||||
use pocketmine\math\RayTraceResult;
|
||||
use pocketmine\utils\CloningRegistryTrait;
|
||||
use pocketmine\world\sound\AmethystBlockChimeSound;
|
||||
use pocketmine\world\sound\BlockPunchSound;
|
||||
use function mb_strtolower;
|
||||
|
||||
/**
|
||||
@ -1466,7 +1470,12 @@ final class VanillaBlocks{
|
||||
|
||||
private static function registerBlocksR17() : void{
|
||||
//in java this can be acquired using any tool - seems to be a parity issue in bedrock
|
||||
self::register("amethyst", new Opaque(new BID(Ids::AMETHYST), "Amethyst", new Info(BreakInfo::pickaxe(1.5, ToolTier::WOOD()))));
|
||||
self::register("amethyst", new class(new BID(Ids::AMETHYST), "Amethyst", new Info(BreakInfo::pickaxe(1.5, ToolTier::WOOD()))) extends Opaque{
|
||||
public function onProjectileHit(Projectile $projectile, RayTraceResult $hitResult) : void{
|
||||
$this->position->getWorld()->addSound($this->position, new AmethystBlockChimeSound());
|
||||
$this->position->getWorld()->addSound($this->position, new BlockPunchSound($this));
|
||||
}
|
||||
});
|
||||
|
||||
self::register("calcite", new Opaque(new BID(Ids::CALCITE), "Calcite", new Info(BreakInfo::pickaxe(0.75, ToolTier::WOOD()))));
|
||||
self::register("tuff", new Opaque(new BID(Ids::TUFF), "Tuff", new Info(BreakInfo::pickaxe(1.5, ToolTier::WOOD(), 30.0))));
|
||||
|
Reference in New Issue
Block a user