diff --git a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/WardenEntity.java b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/WardenEntity.java index e5f81691e..1ca34037c 100644 --- a/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/WardenEntity.java +++ b/core/src/main/java/org/geysermc/geyser/entity/type/living/monster/WardenEntity.java @@ -75,8 +75,8 @@ public class WardenEntity extends MonsterEntity implements Tickable { PlaySoundPacket packet = new PlaySoundPacket(); packet.setSound("mob.warden.heartbeat"); packet.setPosition(position); - packet.setPitch(1.0f); - packet.setVolume((random.nextFloat() - random.nextFloat()) * 0.2f + 1.0f); + packet.setPitch((random.nextFloat() - random.nextFloat()) * 0.2f + 1.0f); + packet.setVolume(1.0f); session.sendUpstreamPacket(packet); } diff --git a/core/src/main/java/org/geysermc/geyser/registry/loader/SoundRegistryLoader.java b/core/src/main/java/org/geysermc/geyser/registry/loader/SoundRegistryLoader.java index 106104d93..6703726ea 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/loader/SoundRegistryLoader.java +++ b/core/src/main/java/org/geysermc/geyser/registry/loader/SoundRegistryLoader.java @@ -54,8 +54,9 @@ public class SoundRegistryLoader implements RegistryLoader next = soundsIterator.next(); JsonNode brMap = next.getValue(); - soundMappings.put(next.getKey(), new SoundMapping( - next.getKey(), + String javaSound = next.getKey(); + soundMappings.put(javaSound, new SoundMapping( + javaSound, brMap.has("bedrock_mapping") && brMap.get("bedrock_mapping").isTextual() ? brMap.get("bedrock_mapping").asText() : null, brMap.has("playsound_mapping") && brMap.get("playsound_mapping").isTextual() ? brMap.get("playsound_mapping").asText() : null, brMap.has("extra_data") && brMap.get("extra_data").isInt() ? brMap.get("extra_data").asInt() : -1, diff --git a/core/src/main/java/org/geysermc/geyser/util/SoundUtils.java b/core/src/main/java/org/geysermc/geyser/util/SoundUtils.java index 6540c17ca..15348939c 100644 --- a/core/src/main/java/org/geysermc/geyser/util/SoundUtils.java +++ b/core/src/main/java/org/geysermc/geyser/util/SoundUtils.java @@ -41,7 +41,9 @@ import org.geysermc.geyser.registry.Registries; import org.geysermc.geyser.registry.type.SoundMapping; import org.geysermc.geyser.session.GeyserSession; -public class SoundUtils { +import java.util.Locale; + +public final class SoundUtils { /** * Maps a sound name to a sound event, null if one @@ -50,9 +52,9 @@ public class SoundUtils { * @param sound the sound name * @return a sound event from the given sound */ - public static SoundEvent toSoundEvent(String sound) { + private static SoundEvent toSoundEvent(String sound) { try { - return SoundEvent.valueOf(sound.toUpperCase().replace(".", "_")); + return SoundEvent.valueOf(sound.toUpperCase(Locale.ROOT).replace(".", "_")); } catch (Exception ex) { return null; } @@ -161,4 +163,7 @@ public class SoundUtils { soundPacket.setRelativeVolumeDisabled(false); session.sendUpstreamPacket(soundPacket); } + + private SoundUtils() { + } }