From d4b06091b986dd69ac42f39507378571b3bec89c Mon Sep 17 00:00:00 2001 From: Josiah Glosson Date: Wed, 28 Aug 2024 16:14:37 -0500 Subject: [PATCH] Fix build --- src/main/java/io/github/gaming32/worldhost/WorldHost.java | 5 ++++- .../simplevoicechat/WorldHostSimpleVoiceChatCompat.java | 4 +--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/github/gaming32/worldhost/WorldHost.java b/src/main/java/io/github/gaming32/worldhost/WorldHost.java index dbf8ef3..19b83b8 100644 --- a/src/main/java/io/github/gaming32/worldhost/WorldHost.java +++ b/src/main/java/io/github/gaming32/worldhost/WorldHost.java @@ -824,7 +824,10 @@ public static void connect(Screen parentScreen, long cid, String host, int port) ); ((ServerDataExt)serverData).wh$setConnectionId(cid); ConnectScreen.startConnecting( - parentScreen, minecraft, serverAddress, serverData, false + parentScreen, minecraft, serverAddress, serverData + //#if MC >= 1.20.1 + , false + //#endif //#if MC >= 1.20.5 , null //#endif diff --git a/src/main/java/io/github/gaming32/worldhost/compat/simplevoicechat/WorldHostSimpleVoiceChatCompat.java b/src/main/java/io/github/gaming32/worldhost/compat/simplevoicechat/WorldHostSimpleVoiceChatCompat.java index f261c9f..8f8b064 100644 --- a/src/main/java/io/github/gaming32/worldhost/compat/simplevoicechat/WorldHostSimpleVoiceChatCompat.java +++ b/src/main/java/io/github/gaming32/worldhost/compat/simplevoicechat/WorldHostSimpleVoiceChatCompat.java @@ -29,9 +29,7 @@ public String getPluginId() { @Override public void registerEvents(EventRegistration registration) { registration.registerEvent(ClientVoicechatInitializationEvent.class, event -> { - final var connection = Minecraft.getInstance().getConnection(); - if (connection == null) return; - final var serverData = (ServerDataExt)connection.getServerData(); + final var serverData = (ServerDataExt)Minecraft.getInstance().getCurrentServer(); if (serverData == null) return; final var connectionId = serverData.wh$getConnectionId(); if (connectionId == null) return;