From 98a282e9f0d86ebab7373dc78d7d63dfe9016e5f Mon Sep 17 00:00:00 2001 From: XiaoMoMi Date: Sun, 30 Mar 2025 01:15:17 +0800 Subject: [PATCH] fix sound --- .../craftengine/bukkit/item/ItemEventListener.java | 8 ++++---- .../core/entity/furniture/FurnitureSounds.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/item/ItemEventListener.java b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/item/ItemEventListener.java index 896c97a5c..6ed73e652 100644 --- a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/item/ItemEventListener.java +++ b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/item/ItemEventListener.java @@ -184,8 +184,8 @@ public class ItemEventListener implements Listener { // so we should check and resend sounds on interact Object blockState = BlockStateUtils.blockDataToBlockState(clickedBlock.getBlockData()); int stateId = BlockStateUtils.blockStateToId(blockState); - ImmutableBlockState againCustomBlock = BukkitBlockManager.instance().getImmutableBlockState(stateId); - if (againCustomBlock == null || againCustomBlock.isEmpty()) { + ImmutableBlockState againstCustomBlock = BukkitBlockManager.instance().getImmutableBlockState(stateId); + if (againstCustomBlock == null || againstCustomBlock.isEmpty()) { return; } @@ -194,13 +194,13 @@ public class ItemEventListener implements Listener { Direction direction = DirectionUtils.toDirection(event.getBlockFace()); BlockHitResult hitResult = new BlockHitResult(vec3d, direction, pos, false); try { - BlockData craftBlockData = BlockStateUtils.fromBlockData(againCustomBlock.vanillaBlockState().handle()); + BlockData craftBlockData = BlockStateUtils.fromBlockData(againstCustomBlock.vanillaBlockState().handle()); if (InteractUtils.isInteractable(KeyUtils.namespacedKey2Key(craftBlockData.getMaterial().getKey()), bukkitPlayer, craftBlockData, hitResult, itemInHand)) { if (!player.isSecondaryUseActive()) { player.setResendSound(); } } else { - if (BlockStateUtils.isReplaceable(againCustomBlock.customBlockState().handle()) && !BlockStateUtils.isReplaceable(againCustomBlock.vanillaBlockState().handle())) { + if (BlockStateUtils.isReplaceable(againstCustomBlock.customBlockState().handle()) && !BlockStateUtils.isReplaceable(againstCustomBlock.vanillaBlockState().handle())) { player.setResendSwing(); } } diff --git a/core/src/main/java/net/momirealms/craftengine/core/entity/furniture/FurnitureSounds.java b/core/src/main/java/net/momirealms/craftengine/core/entity/furniture/FurnitureSounds.java index a2a90b6ca..97cd3a6b0 100644 --- a/core/src/main/java/net/momirealms/craftengine/core/entity/furniture/FurnitureSounds.java +++ b/core/src/main/java/net/momirealms/craftengine/core/entity/furniture/FurnitureSounds.java @@ -23,7 +23,7 @@ public class FurnitureSounds { if (map == null) return EMPTY; return new FurnitureSounds( SoundData.create(map.getOrDefault("break", "minecraft:intentionally_empty"), 1f, 0.8f), - SoundData.create(map.getOrDefault("place", "minecraft:intentionally_empty"), 0f, 0.8f), + SoundData.create(map.getOrDefault("place", "minecraft:intentionally_empty"), 1f, 0.8f), SoundData.create(map.getOrDefault("rotate", "minecraft:intentionally_empty"), 1f, 0.8f) ); }