Skip to content

Commit

Permalink
Fix connection mixin crashing when leaving a singleplayer game
Browse files Browse the repository at this point in the history
  • Loading branch information
AsoDesu committed Jul 6, 2023
1 parent 4fe6c8b commit 5b95679
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ minecraft_version=1.20.1
yarn_mappings=1.20.1+build.2
loader_version=0.14.21
# Mod Properties
mod_version=1.4.3
mod_version=1.4.4
maven_group=net.asodev
archives_base_name=islandutils
# Dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ 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();
Expand Down

0 comments on commit 5b95679

Please sign in to comment.