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 LANfor it to be displayed on
the bottom of the server list.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanclose()Closes the server to LAN.static booleanisOpen()Checks if the server is currently opened to LAN.static booleanopen()Opens the server to LAN with the default config.static booleanopen(@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:
trueif it was opened successfully,falseotherwise
-
open
Opens the server to LAN.- Parameters:
config- the configuration- Returns:
trueif it was opened successfully,falseotherwise
-
close
public static boolean close()Closes the server to LAN.- Returns:
trueif it was closed,falseif it was already closed
-
isOpen
public static boolean isOpen()Checks if the server is currently opened to LAN.- Returns:
trueif it is,falseotherwise
-