Package net.minestom.server.extras.lan
Class OpenToLAN
java.lang.Object
net.minestom.server.extras.lan.OpenToLAN
Utility class to manage opening the server to LAN. Note that this doesn't actually
open your server to LAN if it isn't already visible to anyone on your local network.
Instead it simply sends the packets needed to trick the Minecraft client into thinking
that this is a single-player world that has been opened to LAN for it to be displayed on
the bottom of the server list.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
close()
Closes the server to LAN.static boolean
isOpen()
Checks if the server is currently opened to LAN.static boolean
open()
Opens the server to LAN with the default config.static boolean
open
(@NotNull OpenToLANConfig config) Opens the server to LAN.
-
Method Details
-
open
public static boolean open()Opens the server to LAN with the default config.- Returns:
true
if it was opened successfully,false
otherwise
-
open
Opens the server to LAN.- Parameters:
config
- the configuration- Returns:
true
if it was opened successfully,false
otherwise
-
close
public static boolean close()Closes the server to LAN.- Returns:
true
if it was closed,false
if it was already closed
-
isOpen
public static boolean isOpen()Checks if the server is currently opened to LAN.- Returns:
true
if it is,false
otherwise
-