fix most (or all) missing block placement sounds

This commit is contained in:
ForestOfLight
2025-07-10 16:23:29 -07:00
Unverified
parent e53255acc8
commit 7cc2233545
2 changed files with 3663 additions and 6 deletions
File diff suppressed because it is too large Load Diff
+3 -6
View File
@@ -1,7 +1,7 @@
import { system, EntityComponentTypes, LiquidType } from '@minecraft/server'; import { system, EntityComponentTypes, LiquidType } from '@minecraft/server';
import { FormCancelationReason } from '@minecraft/server-ui'; import { FormCancelationReason } from '@minecraft/server-ui';
import { specialItemPlacementConversions } from './data'; import { specialItemPlacementConversions } from './data';
import { blocks } from './blocks'; import { blocks, block_sounds } from './blocks';
export async function forceShow(player, form, timeout = Infinity) { export async function forceShow(player, form, timeout = Infinity) {
const startTick = system.currentTick; const startTick = system.currentTick;
@@ -62,10 +62,7 @@ function playBlockPlacementSound(player, block, structureBlock) {
const blockId = structureBlock.type.id.replace('minecraft:', ''); const blockId = structureBlock.type.id.replace('minecraft:', '');
const blockData = blocks[blockId]; const blockData = blocks[blockId];
let blockSound = blockData['sound'] || 'stone'; let blockSound = blockData['sound'] || 'stone';
if (['glass', 'terracotta'].includes(blockSound)) let blockSoundId = block_sounds[blockSound].events.place?.sound
blockSound = 'stone'; || block_sounds[block_sounds[blockSound].base].events.place?.sound;
let blockSoundId = 'dig.' + blockSound;
if (['iron', 'calcite'].includes(blockSound))
blockSoundId = 'place.' + blockSound;
player.dimension.playSound(blockSoundId, block.location); player.dimension.playSound(blockSoundId, block.location);
} }