Package net.minestom.server.extras.query
Class Query
java.lang.Object
net.minestom.server.extras.query.Query
Utility class to manage responses to the GameSpy4 Query Protocol.
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanChecks if the query system has been started.static intstart()Starts the query system, responding to queries on a random port, logging if it could not be started.static booleanstart(int port) Starts the query system, responding to queries on a given port, logging if it could not be started.static booleanstop()Stops the query system.
-
Field Details
-
CHARSET
-
-
Method Details
-
start
public static int start()Starts the query system, responding to queries on a random port, logging if it could not be started.- Returns:
- the port
- Throws:
IllegalArgumentException- if the system was already running
-
start
public static boolean start(int port) Starts the query system, responding to queries on a given port, logging if it could not be started.- Parameters:
port- the port- Returns:
trueif the query system started successfully,falseotherwise
-
stop
public static boolean stop()Stops the query system.- Returns:
trueif the query system was stopped,falseif it was not running
-
isStarted
public static boolean isStarted()Checks if the query system has been started.- Returns:
trueif it has been started,falseotherwise
-