9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-27 10:59:07 +00:00
This commit is contained in:
jhqwqmc
2025-09-24 16:43:20 +08:00
parent a3e9e74913
commit 71915dce84

View File

@@ -33,7 +33,12 @@ public class ChimeBlockBehavior extends BukkitBlockBehavior {
@Override
public BlockBehavior create(CustomBlock block, Map<String, Object> arguments) {
SoundData hitSound = SoundData.create(ResourceConfigUtils.requireNonNullOrThrow(arguments.get("hit-sound"), "warning.config.block.behavior.chime.missing_hit_sound"), SoundData.SoundValue.FIXED_1, SoundData.SoundValue.ranged(0.9f, 1f));
SoundData hitSound = SoundData.create(ResourceConfigUtils.requireNonNullOrThrow(
Optional.ofNullable(arguments.get("sounds"))
.map(o -> ResourceConfigUtils.getAsMap(o , "hit").get("hit"))
.orElse(null),
"warning.config.block.behavior.chime.missing_hit_sound"
), SoundData.SoundValue.FIXED_1, SoundData.SoundValue.ranged(0.9f, 1f));
return new ChimeBlockBehavior(block, hitSound);
}
}