Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void handle(final SPlaySoundPacket msg, Supplier<NetworkEvent.Context> ctx) {
- ctx.get().enqueueWork(() -> {
- Minecraft minecraft = Minecraft.getInstance();
- if (msg.global) minecraft.getSoundHandler().play(SimpleSound.master(msg.sound, 1.0F));
- else if (minecraft.player != null) minecraft.player.playSound(msg.sound, 1.0F, 1.0F);
- });
- ctx.get().setPacketHandled(true);
- }
Advertisement
Add Comment
Please, Sign In to add comment