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
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Checks if the query system has been started.static int
start()
Starts the query system, responding to queries on a random port, logging if it could not be started.static boolean
start
(int port) Starts the query system, responding to queries on a given port, logging if it could not be started.static boolean
stop()
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:
true
if the query system started successfully,false
otherwise
-
stop
public static boolean stop()Stops the query system.- Returns:
true
if the query system was stopped,false
if it was not running
-
isStarted
public static boolean isStarted()Checks if the query system has been started.- Returns:
true
if it has been started,false
otherwise
-