Skip to content

Commit 2175512

Browse files
sensen1234chsbuffer
authored andcommitted
fix int
1 parent 0c6458a commit 2175512

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/com/gmail/gorayan3838/notebetterfabric/mixin/NoteBlockMixin.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ public class NoteBlockMixin {
2525

2626
@Redirect(method = "onSyncedBlockEvent", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;playSound(Lnet/minecraft/entity/player/PlayerEntity;DDDLnet/minecraft/registry/entry/RegistryEntry;Lnet/minecraft/sound/SoundCategory;FFJ)V"))
2727
private void injected(World world, @Nullable PlayerEntity player, double x, double y, double z, RegistryEntry<SoundEvent> sound, SoundCategory category, float volume, float pitch, long seed) {
28-
BlockPos pos = new BlockPos((int) x, (int) y, (int) z);
28+
BlockPos pos = new BlockPos((int) Math.floor(x), (int) Math.floor(y), (int) Math.floor(z));
2929
SoundConfig.Mapping[] mappings = NoteBetterFabric.CONFIG.getMappings();
30-
List<SoundConfig.Mapping> filteredMappings = Arrays.stream(mappings).filter(mapping -> world.getBlockState(pos.down()).getBlock().equals(Registries.BLOCK.get(new Identifier(mapping.getBlock())))).toList();
30+
List<SoundConfig.Mapping> filteredMappings = Arrays.stream(mappings)
31+
.filter(mapping -> world.getBlockState(pos.down()).getBlock().equals(Registries.BLOCK.get(new Identifier(mapping.getBlock()))))
32+
.toList();
3133
filteredMappings.forEach(mapping -> {
3234
SoundConfig.Sound soundInfo = mapping.getSound();
3335
world.playSound(

0 commit comments

Comments
 (0)