From 5cf5163d759d3affff34ce8da6db1089a93477ad Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sat, 2 Sep 2023 19:57:01 +0700 Subject: [PATCH] IT FIWX 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(); - - 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) { + ci.cancel(); + } catch (NumberFormatException e) { e.printStackTrace(); } + + if (t_packet.getVolume() == 1 && sound.getPath().equals("entity.enderman.scream")) ci.cancel(); } }