fix most (or all) missing block placement sounds
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -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);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user