From 2e87ea59da4e7a3a56f24641c22aeac50cc5b607 Mon Sep 17 00:00:00 2001 From: anhgelus Date: Fri, 23 Aug 2024 14:22:41 +0000 Subject: fix(networking): crash while joining server --- .../java/world/anhgelus/molehunt/client/MolehuntClient.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/client') diff --git a/src/client/java/world/anhgelus/molehunt/client/MolehuntClient.java b/src/client/java/world/anhgelus/molehunt/client/MolehuntClient.java index 7770a1b..1f92573 100644 --- a/src/client/java/world/anhgelus/molehunt/client/MolehuntClient.java +++ b/src/client/java/world/anhgelus/molehunt/client/MolehuntClient.java @@ -13,13 +13,11 @@ public class MolehuntClient implements ClientModInitializer { @Override public void onInitializeClient() { ClientPlayNetworking.registerGlobalReceiver(ConfigPayload.ID, (payload, context) -> { - try (final var client = context.client()) { - client.execute(() -> { - SHOW_SKINS = payload.showSkins(); - SHOW_NAMETAGS = payload.showNametags(); - SHOW_TAB = payload.showTab(); - }); - } + context.client().execute(() -> { + SHOW_SKINS = payload.showSkins(); + SHOW_NAMETAGS = payload.showNametags(); + SHOW_TAB = payload.showTab(); + }); }); } -- cgit v1.2.3