diff --git a/src/block/VanillaBlocks.php b/src/block/VanillaBlocks.php index 4b1c127e1..585bf759d 100644 --- a/src/block/VanillaBlocks.php +++ b/src/block/VanillaBlocks.php @@ -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)))); diff --git a/src/world/sound/AmethystBlockChimeSound.php b/src/world/sound/AmethystBlockChimeSound.php new file mode 100644 index 000000000..64efbb8ce --- /dev/null +++ b/src/world/sound/AmethystBlockChimeSound.php @@ -0,0 +1,35 @@ +