Join Address gathering fix by Dreeam-qwq (#3242)

Fixes gathering for addresses without port on Bukkit based platforms
This commit is contained in:
Dreeam 2023-10-03 14:02:30 -04:00 committed by GitHub
parent 956e712169
commit ee1f337eff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -85,7 +85,9 @@ public class PlayerOnlineListener implements Listener {
String address = event.getHostname();
if (!address.isEmpty()) {
address = address.substring(0, address.lastIndexOf(':'));
if (address.contains(":")) {
address = address.substring(0, address.lastIndexOf(':'));
}
if (address.contains("\u0000")) {
address = address.substring(0, address.indexOf('\u0000'));
}

View File

@ -107,7 +107,8 @@ public class Contributors {
new Contributor("lis2a", LANG),
new Contributor("ToxiWoxi", CODE),
new Contributor("xlanyleeet", LANG),
new Contributor("Jumala9163", LANG)
new Contributor("Jumala9163", LANG),
new Contributor("Dreeam-qwq", CODE)
};
private Contributors() {