refactor: at least reduce a bit of the mess

also about the pitch issue, it actually was intended to be like that, the clamp bypass already works, i just thought it can go unlimited
This commit is contained in:
Chayapak Supasakul 2025-03-06 20:12:40 +07:00
parent c1c7907e49
commit 8b7545ac16
Signed by: ChomeNS
SSH key fingerprint: SHA256:0YoxhdyXsgbc0nfeB2N6FYE60mxMU7DS4uCUMaw2mvA

View file

@ -66,10 +66,28 @@ public class ClientConnectionMixin {
if (world == null) return;
// huge mess
final SoundEvent newSound = SoundEvent.of(Identifier.of(sound.getNamespace(), sound.getPath().substring(0, sound.getPath().length() - (".pitch." + stringPitch).length())));
final SoundEvent newSound = SoundEvent.of(
Identifier.of(
sound.getNamespace(),
sound.getPath().substring(0, sound.getPath().length() - (".pitch." + stringPitch).length())
)
);
client.executeSync(() -> world.playSound(client.player, t_packet.getX(), t_packet.getY(), t_packet.getZ(), newSound, t_packet.getCategory(), t_packet.getVolume(), pitch, t_packet.getSeed()));
client.execute(() -> world.playSound(
client.player,
t_packet.getX(),
t_packet.getY(),
t_packet.getZ(),
newSound,
t_packet.getCategory(),
t_packet.getVolume(),
pitch,
t_packet.getSeed()
));
ci.cancel();
} catch (NumberFormatException e) {