Interface TestDedicatedServerContext
- All Superinterfaces:
AutoCloseable
,TestServerContext
Context for a client gametest containing various helpful functions while an in-process dedicated server is running.
This class implements
AutoCloseable
and is intended to be used in a try-with-resources statement. When
closed, the dedicated server will be stopped.
Functions in this class can only be called on the client gametest thread.
-
Method Summary
Methods inherited from interface net.fabricmc.fabric.api.client.gametest.v1.TestServerContext
computeOnServer, runCommand, runOnServer
-
Method Details
-
connect
TestServerConnection connect()Connects the client to the dedicated server. The resulting connection is intended to be used in a try-with-resources statement.- Returns:
- The connection handle to the dedicated server
-
close
void close()Stops the dedicated server.- Specified by:
close
in interfaceAutoCloseable
-