Skip to content

Commit

Permalink
Oops
Browse files Browse the repository at this point in the history
  • Loading branch information
AsoDesu committed Jul 6, 2023
1 parent 5b95679 commit cdeb107
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ public abstract class ConnectionMixin {

@Inject(method = "disconnect", at = @At("HEAD"))
private void disconnect(Component component, CallbackInfo ci) {
if (getRemoteAddress() == null) return;
String hostName = ((InetSocketAddress) getRemoteAddress()).getHostName();
if (hostName == null) return;
if (hostName.contains("mccisland.net")) {
DiscordPresenceUpdator.started = null;
DiscordPresenceUpdator.clear();
MccIslandState.setGame(GAME.HUB);
SocketAddress remoteAddress = getRemoteAddress();
if (remoteAddress == null) return;
if (remoteAddress instanceof InetSocketAddress socketAddress) {
String hostName = socketAddress.getHostName();
if (hostName == null) return;
if (hostName.contains("mccisland.net")) {
DiscordPresenceUpdator.started = null;
DiscordPresenceUpdator.clear();
MccIslandState.setGame(GAME.HUB);
}
}
}

Expand Down

0 comments on commit cdeb107

Please sign in to comment.