Package net.minestom.server.extras.lan
Class OpenToLANConfig
java.lang.Object
net.minestom.server.extras.lan.OpenToLANConfig
Configuration for opening the server to LAN.
- See Also:
-
Constructor Summary
ConstructorDescriptionCreates a new config with the port set to random and the delay between pings set to 1.5 seconds and the delay between event calls set to 30 seconds. -
Method Summary
Modifier and TypeMethodDescription@NotNull OpenToLANConfig
eventCallDelay
(@NotNull Duration delay) Sets the delay between calls ofServerListPingEvent
.@NotNull OpenToLANConfig
Sets the delay between outgoing pings.@NotNull OpenToLANConfig
port
(int port) Sets the port used to send pings from.
-
Constructor Details
-
OpenToLANConfig
public OpenToLANConfig()Creates a new config with the port set to random and the delay between pings set to 1.5 seconds and the delay between event calls set to 30 seconds.
-
-
Method Details
-
port
Sets the port used to send pings from. Use0
to pick a random free port.- Parameters:
port
- the port- Returns:
this
, for chaining
-
pingDelay
@Contract("_ -> this") @NotNull public @NotNull OpenToLANConfig pingDelay(@NotNull @NotNull Duration delay) Sets the delay between outgoing pings.- Parameters:
delay
- the delay- Returns:
this
, for chaining
-
eventCallDelay
@Contract("_ -> this") @NotNull public @NotNull OpenToLANConfig eventCallDelay(@NotNull @NotNull Duration delay) Sets the delay between calls ofServerListPingEvent
.- Parameters:
delay
- the delay- Returns:
this
, for chaining
-