diff options
| author | Florian Rinke <develop@torui.de> | 2021-11-05 21:23:36 +0100 |
|---|---|---|
| committer | Florian Rinke <develop@torui.de> | 2021-11-05 21:23:36 +0100 |
| commit | e45c77e7bae2bc6250b31d1d8e01bab75d7966ed (patch) | |
| tree | 4858b92ccfcf27f97797777d879ba891e5519ffe /src/main/java/de/torui/coflsky/network | |
| parent | 5cc73b705cf4c6d6887e650daf8222b63dedc011 (diff) | |
| download | COFL-e45c77e7bae2bc6250b31d1d8e01bab75d7966ed.tar.gz COFL-e45c77e7bae2bc6250b31d1d8e01bab75d7966ed.tar.bz2 COFL-e45c77e7bae2bc6250b31d1d8e01bab75d7966ed.zip | |
Handle Fail more graceful
Diffstat (limited to 'src/main/java/de/torui/coflsky/network')
| -rw-r--r-- | src/main/java/de/torui/coflsky/network/WSClientWrapper.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/main/java/de/torui/coflsky/network/WSClientWrapper.java b/src/main/java/de/torui/coflsky/network/WSClientWrapper.java index f30d0f9..21f494f 100644 --- a/src/main/java/de/torui/coflsky/network/WSClientWrapper.java +++ b/src/main/java/de/torui/coflsky/network/WSClientWrapper.java @@ -13,7 +13,11 @@ import de.torui.coflsky.core.Command; import de.torui.coflsky.core.StringCommand; import de.torui.coflsky.minecraft_integration.PlayerDataProvider; import net.minecraft.client.Minecraft; +import net.minecraft.event.ClickEvent; +import net.minecraft.event.ClickEvent.Action; import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatStyle; +import net.minecraft.util.EnumChatFormatting; import de.torui.coflsky.minecraft_integration.CoflSessionManager; @@ -63,7 +67,17 @@ public class WSClientWrapper { } } - throw new Error("Could not connect to any websocket remote!"); + Minecraft.getMinecraft().thePlayer.addChatMessage( + new ChatComponentText("Cofl could not establish a connection to any server!"+ + "\nIf you think this is a bug. Please report it on our Discord and include the logs!") + .setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)) + /*.appendSibling(new ChatComponentText("logs") + .setChatStyle(new ChatStyle() + .setChatClickEvent(new ClickEvent(Action.OPEN_URL, ""))))*/); + + return false; + //throw new Error("Could not connect to any websocket remote!"); + } |
