mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 00:37:52 +00:00
Fix LAN server IPs being duplicated Fix connecting to vanilla servers due to misapplied patch.
25 lines
1.2 KiB
Diff
25 lines
1.2 KiB
Diff
--- a/net/minecraft/client/server/LanServerDetection.java
|
|
+++ b/net/minecraft/client/server/LanServerDetection.java
|
|
@@ -33,7 +_,7 @@
|
|
this.setDaemon(true);
|
|
this.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(LanServerDetection.LOGGER));
|
|
this.socket = new MulticastSocket(4445);
|
|
- this.pingGroup = InetAddress.getByName("224.0.2.60");
|
|
+ this.pingGroup = InetAddress.getByName(LanServerPinger.MULTICAST_GROUP);
|
|
this.socket.setSoTimeout(5000);
|
|
this.socket.joinGroup(this.pingGroup);
|
|
}
|
|
@@ -88,7 +_,11 @@
|
|
String s = LanServerPinger.parseMotd(p_120097_);
|
|
String s1 = LanServerPinger.parseAddress(p_120097_);
|
|
if (s1 != null) {
|
|
- s1 = p_120098_.getHostAddress() + ":" + s1;
|
|
+ if (net.minecraftforge.network.DualStackUtils.checkIPv6(p_120098_)) {
|
|
+ s1 = "[" + com.google.common.net.InetAddresses.toAddrString(p_120098_) + "]:" + s1;
|
|
+ } else {
|
|
+ s1 = p_120098_.getHostAddress() + ":" + s1;
|
|
+ }
|
|
boolean flag = false;
|
|
|
|
for (LanServer lanserver : this.servers) {
|