Class LanServerPinger

java.lang.Object
java.lang.Thread
net.minecraft.client.network.LanServerPinger
All Implemented Interfaces:
Runnable

@Environment(CLIENT) public class LanServerPinger extends Thread
Used to send UDP multicasts to notify other clients of a local game on the same network.

These multicasts will always be sent to 224.0.2.60:4445 where other clients can listen for local games.

Mappings:
Namespace Name
official fwz
intermediary net/minecraft/class_1133
named net/minecraft/client/network/LanServerPinger
  • Field Details

    • THREAD_ID

      private static final AtomicInteger THREAD_ID
      Mappings:
      Namespace Name Mixin selector
      official c Lfwz;c:Ljava/util/concurrent/atomic/AtomicInteger;
      intermediary field_5525 Lnet/minecraft/class_1133;field_5525:Ljava/util/concurrent/atomic/AtomicInteger;
      named THREAD_ID Lnet/minecraft/client/network/LanServerPinger;THREAD_ID:Ljava/util/concurrent/atomic/AtomicInteger;
    • LOGGER

      private static final Logger LOGGER
      Mappings:
      Namespace Name Mixin selector
      official d Lfwz;d:Lorg/slf4j/Logger;
      intermediary field_5529 Lnet/minecraft/class_1133;field_5529:Lorg/slf4j/Logger;
      named LOGGER Lnet/minecraft/client/network/LanServerPinger;LOGGER:Lorg/slf4j/Logger;
    • PING_ADDRESS

      public static final String PING_ADDRESS
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Lfwz;a:Ljava/lang/String;
      intermediary field_33016 Lnet/minecraft/class_1133;field_33016:Ljava/lang/String;
      named PING_ADDRESS Lnet/minecraft/client/network/LanServerPinger;PING_ADDRESS:Ljava/lang/String;
    • PING_PORT

      public static final int PING_PORT
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official b Lfwz;b:I
      intermediary field_33017 Lnet/minecraft/class_1133;field_33017:I
      named PING_PORT Lnet/minecraft/client/network/LanServerPinger;PING_PORT:I
    • PING_INTERVAL

      private static final long PING_INTERVAL
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official e Lfwz;e:J
      intermediary field_33018 Lnet/minecraft/class_1133;field_33018:J
      named PING_INTERVAL Lnet/minecraft/client/network/LanServerPinger;PING_INTERVAL:J
    • motd

      private final String motd
      Mappings:
      Namespace Name Mixin selector
      official f Lfwz;f:Ljava/lang/String;
      intermediary field_5526 Lnet/minecraft/class_1133;field_5526:Ljava/lang/String;
      named motd Lnet/minecraft/client/network/LanServerPinger;motd:Ljava/lang/String;
    • socket

      private final DatagramSocket socket
      Mappings:
      Namespace Name Mixin selector
      official g Lfwz;g:Ljava/net/DatagramSocket;
      intermediary field_5528 Lnet/minecraft/class_1133;field_5528:Ljava/net/DatagramSocket;
      named socket Lnet/minecraft/client/network/LanServerPinger;socket:Ljava/net/DatagramSocket;
    • running

      private boolean running
      Mappings:
      Namespace Name Mixin selector
      official h Lfwz;h:Z
      intermediary field_5527 Lnet/minecraft/class_1133;field_5527:Z
      named running Lnet/minecraft/client/network/LanServerPinger;running:Z
    • addressPort

      private final String addressPort
      Mappings:
      Namespace Name Mixin selector
      official i Lfwz;i:Ljava/lang/String;
      intermediary field_5530 Lnet/minecraft/class_1133;field_5530:Ljava/lang/String;
      named addressPort Lnet/minecraft/client/network/LanServerPinger;addressPort:Ljava/lang/String;
  • Constructor Details

    • LanServerPinger

      public LanServerPinger(String motd, String addressPort) throws IOException
      Throws:
      IOException
      Mappings:
      Namespace Name Mixin selector
      official <init> Lfwz;<init>(Ljava/lang/String;Ljava/lang/String;)V
      intermediary <init> Lnet/minecraft/class_1133;<init>(Ljava/lang/String;Ljava/lang/String;)V
      named <init> Lnet/minecraft/client/network/LanServerPinger;<init>(Ljava/lang/String;Ljava/lang/String;)V
  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • interrupt

      public void interrupt()
      Overrides:
      interrupt in class Thread
    • createAnnouncement

      public static String createAnnouncement(String motd, String addressPort)
      Creates a server announcement.
       [MOTD] // Specifies the beginning of the message of the day
       A message of the day // The message of the day
       [/MOTD] // Specifies the end of the message of the day.
       [AD] // Specifies the beginning of the address and the port of the local server.
       the address of the local server. // Such as 192.146.2.1:23132
       [/AD] // Specifies the end of the address and port of the local server.
       

      An example of a complete announcement: [MOTD]A Player's Server[/MOTD][AD]192.168.0.33[/AD]

      Parameters:
      motd - the message of the day
      addressPort - the address of the server including the IP address and port
      Mappings:
      Namespace Name Mixin selector
      official a Lfwz;a(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
      intermediary method_4818 Lnet/minecraft/class_1133;method_4818(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
      named createAnnouncement Lnet/minecraft/client/network/LanServerPinger;createAnnouncement(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    • parseAnnouncementMotd

      public static String parseAnnouncementMotd(String announcement)
      Mappings:
      Namespace Name Mixin selector
      official a Lfwz;a(Ljava/lang/String;)Ljava/lang/String;
      intermediary method_4819 Lnet/minecraft/class_1133;method_4819(Ljava/lang/String;)Ljava/lang/String;
      named parseAnnouncementMotd Lnet/minecraft/client/network/LanServerPinger;parseAnnouncementMotd(Ljava/lang/String;)Ljava/lang/String;
    • parseAnnouncementAddressPort

      public static String parseAnnouncementAddressPort(String announcement)
      Mappings:
      Namespace Name Mixin selector
      official b Lfwz;b(Ljava/lang/String;)Ljava/lang/String;
      intermediary method_4820 Lnet/minecraft/class_1133;method_4820(Ljava/lang/String;)Ljava/lang/String;
      named parseAnnouncementAddressPort Lnet/minecraft/client/network/LanServerPinger;parseAnnouncementAddressPort(Ljava/lang/String;)Ljava/lang/String;