IT FIWX<S<AD,sit894758743987589437598437583758937589rtghrfdjk

FUCK YOU
This commit is contained in:
Chayapak 2023-09-02 19:57:01 +07:00
parent 80d67f17f8
commit 5cf5163d75

View file

@ -49,6 +49,8 @@ public class ClientConnectionMixin {
listener.packetReceived(packet); listener.packetReceived(packet);
} }
final MinecraftClient client = MinecraftClient.getInstance();
// please don't skid this.,. // please don't skid this.,.
// mabe mabe mabe // mabe mabe mabe
if (packet instanceof ParticleS2CPacket t_packet) { if (packet instanceof ParticleS2CPacket t_packet) {
@ -58,40 +60,34 @@ public class ClientConnectionMixin {
ci.cancel(); ci.cancel();
} }
} else if (packet instanceof PlaySoundS2CPacket t_packet) { } else if (packet instanceof PlaySoundS2CPacket t_packet) {
final SoundEvent soundEvent = t_packet.getSound().value();
final Identifier sound = soundEvent.getId();
final Matcher matcher = CUSTOM_PITCH_PATTERN.matcher(sound.getPath());
if (!matcher.find()) return;
try { try {
final SoundEvent soundEvent = t_packet.getSound().value(); final String stringPitch = matcher.group(1);
final Identifier sound = soundEvent.getId(); final float pitch = Float.parseFloat(stringPitch);
final Matcher matcher = CUSTOM_PITCH_PATTERN.matcher(sound.getPath()); final ClientWorld world = client.world;
if (!matcher.find()) return; if (world == null) return;
try { // huge mess
final String stringPitch = matcher.group(1); final SoundEvent newSound = SoundEvent.of(new Identifier(sound.getNamespace(), sound.getPath().substring(0, sound.getPath().length() - (".pitch." + stringPitch).length())));
final float pitch = Float.parseFloat(stringPitch); 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()));
final MinecraftClient client = MinecraftClient.getInstance(); ci.cancel();
} catch (NumberFormatException e) {
final ClientWorld world = client.world;
if (world == null) return;
// huge mess
final SoundEvent newSound = SoundEvent.of(new Identifier(sound.getNamespace(), sound.getPath().substring(0, sound.getPath().length() - (".pitch." + stringPitch).length())));
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) {
e.printStackTrace();
}
if (t_packet.getVolume() == 1 && sound.getPath().equals("entity.enderman.scream")) ci.cancel();
} catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
if (t_packet.getVolume() == 1 && sound.getPath().equals("entity.enderman.scream")) ci.cancel();
} }
} }