| Total Complexity | 2 |
| Total Lines | 12 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | package de.pewpewproject.lasertag.networking.client.callbacks; |
||
| 16 | public class PlayerActivatedSoundEventCallback implements ClientPlayNetworking.PlayChannelHandler { |
||
| 17 | @Override |
||
| 18 | public void receive(MinecraftClient client, ClientPlayNetworkHandler handler, PacketByteBuf buf, PacketSender responseSender) { |
||
| 19 | |||
| 20 | try { |
||
| 21 | |||
| 22 | // Execute sound playing on main thread to avoid weird exceptions |
||
| 23 | client.execute(() -> |
||
| 24 | client.player.playSound(SoundEvents.BLOCK_BEACON_ACTIVATE, 1.0F, 1.0F)); |
||
| 25 | } catch (Exception ex) { |
||
| 26 | LasertagMod.LOGGER.error("Error in PlayerActivatedSoundEventCallback", ex); |
||
| 27 | throw ex; |
||
| 28 | } |
||
| 31 |