Skip to content

Commit

Permalink
Merge pull request #34 from RappyLabyAddons/bug/rpc
Browse files Browse the repository at this point in the history
RPC showing when not connected to Opsucht.net
  • Loading branch information
RappyTV authored Nov 20, 2023
2 parents e2ac617 + ea23e52 commit aea1d6c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ labyMod {
author = "RappyTV"
description = "Adds some ingame utilities for OPSUCHT.net | Not affiliated with Interwebmedia GmbH"
minecraftVersion = "1.19<*"
version = System.getenv().getOrDefault("VERSION", "1.1.5")
version = System.getenv().getOrDefault("VERSION", "1.1.6")
}

minecraft {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,18 @@ public ServerNavigationListener(OPSuchtAddon addon) {

@Subscribe
public void onServerJoin(ServerJoinEvent event) {
if(isOpSucht(event.serverData()))
if(isOpSucht(event.serverData())) {
OPSuchtAddon.setConnected(true);
Laby.labyAPI().minecraft().executeNextTick(() -> addon.rpcManager.updateCustomRPC(true));
Laby.labyAPI().minecraft().executeNextTick(() -> addon.rpcManager.updateCustomRPC(true));
}
}

@Subscribe
public void onServerSwitch(ServerSwitchEvent event) {
OPSuchtAddon.setConnected(isOpSucht(event.newServerData()));
Laby.labyAPI().minecraft().executeNextTick(() -> addon.rpcManager.updateCustomRPC(true));
if(isOpSucht(event.newServerData())) {
OPSuchtAddon.setConnected(true);
Laby.labyAPI().minecraft().executeNextTick(() -> addon.rpcManager.updateCustomRPC(true));
}
}

@Subscribe
Expand Down

0 comments on commit aea1d6c

Please sign in to comment.