From b2413b8b827d4e393914f8904d77763226e1ecf2 Mon Sep 17 00:00:00 2001 From: kirillsaint Date: Thu, 9 Nov 2023 00:27:20 +0600 Subject: [PATCH] isIntegratedServerRunning bridge --- .../net/silentclient/client/bridges/MinecraftBridge.java | 5 +++++ src/main/java/net/silentclient/clientcommon/Client.java | 2 +- .../clientcommon/types/interfaces/bridges/IMinecraft.java | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/silentclient/client/bridges/MinecraftBridge.java b/src/main/java/net/silentclient/client/bridges/MinecraftBridge.java index 9e25f38..863b4a5 100644 --- a/src/main/java/net/silentclient/client/bridges/MinecraftBridge.java +++ b/src/main/java/net/silentclient/client/bridges/MinecraftBridge.java @@ -43,4 +43,9 @@ public class MinecraftBridge implements IMinecraft { public ITextureManager getTextureManager() { return textureManager; } + + @Override + public boolean isIntegratedServerRunning() { + return Minecraft.getMinecraft().isIntegratedServerRunning(); + } } diff --git a/src/main/java/net/silentclient/clientcommon/Client.java b/src/main/java/net/silentclient/clientcommon/Client.java index beffa08..b3c1a12 100644 --- a/src/main/java/net/silentclient/clientcommon/Client.java +++ b/src/main/java/net/silentclient/clientcommon/Client.java @@ -482,7 +482,7 @@ public class Client { return; } - if(Minecraft.getMinecraft().getCurrentServerData() != null && !Minecraft.getMinecraft().isIntegratedServerRunning()) { + if(Minecraft.getMinecraft().getCurrentServerData() != null && !Client.getWrapper().getMinecraft().isIntegratedServerRunning()) { if(nextPing > 0) { nextPing--; } diff --git a/src/main/java/net/silentclient/clientcommon/types/interfaces/bridges/IMinecraft.java b/src/main/java/net/silentclient/clientcommon/types/interfaces/bridges/IMinecraft.java index 3537f8d..6956b51 100644 --- a/src/main/java/net/silentclient/clientcommon/types/interfaces/bridges/IMinecraft.java +++ b/src/main/java/net/silentclient/clientcommon/types/interfaces/bridges/IMinecraft.java @@ -13,4 +13,5 @@ public interface IMinecraft { void displayGuiScreen(GuiScreen guiScreen); // Как видишь, TextureManager это класс из net.minecraft, поэтому тебе нужно создать обертку ITextureManager getTextureManager(); + boolean isIntegratedServerRunning(); }