Skip to content

Commit fc1888c

Browse files
committed
stop connection when leaving hypixel
1 parent a39930c commit fc1888c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/client/java/com/coflnet/CoflModClient.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,13 @@ public void onInitializeClient() {
176176
uploadedScoreboard = false;
177177
});
178178

179+
ClientPlayConnectionEvents.DISCONNECT.register((handler, server) -> {
180+
if (CoflCore.Wrapper.isRunning) {
181+
System.out.println("Disconnected from server");
182+
CoflCore.Wrapper.stop();
183+
}
184+
});
185+
179186
ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> {
180187
dispatcher.register(ClientCommandManager.literal("cofl")
181188
.then(ClientCommandManager.argument("args", StringArgumentType.greedyString())

0 commit comments

Comments
 (0)