Skip to content

Commit

Permalink
shutdown on disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
nothub committed Apr 6, 2024
1 parent 4d711cd commit 0fb5943
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main/java/lol/hub/headlessbot/Mod.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,23 @@ public void onInitializeClient() {
}

ScreenEvents.AFTER_INIT.register((client, screen, scaledWidth, scaledHeight) -> {
if (screen instanceof AccessibilityOnboardingScreen sc) {
if (screen instanceof AccessibilityOnboardingScreen) {
Log.info("Closing AccessibilityOnboardingScreen");
screen.close();
} else if (screen instanceof MultiplayerWarningScreen sc) {
} else if (screen instanceof MultiplayerWarningScreen) {
Log.info("Closing MultiplayerWarningScreen");
screen.close();
} else if (screen instanceof ConnectScreen) {
Log.info("Connecting ...");
} else if (screen instanceof DisconnectedScreen) {
Log.info("Disconnecting ...");
Log.info("Disconnected, shutting down ...");
System.exit(0);
} else if (screen instanceof DownloadingTerrainScreen) {
Log.info("Downloading terrain ...");
} else if (screen instanceof ProgressScreen) {
Log.info("Awaiting progress ...");
} else if (screen instanceof MessageScreen sc) {
Log.info("Showing mssage: %s", sc.getTitle().getString());
} else if (screen instanceof MessageScreen) {
Log.info("Showing mssage: %s", screen.getTitle().getString());
} else {
Log.info("Showing screen: %s", screen.getClass().getSimpleName());
}
Expand Down

0 comments on commit 0fb5943

Please sign in to comment.