Package emu.grasscutter.plugin.api
Class ServerHook
java.lang.Object
emu.grasscutter.plugin.api.ServerHook
Hooks into the
GameServer class, adding convenient ways to do certain things.-
Constructor Summary
ConstructorsConstructorDescriptionServerHook(GameServer gameServer, DispatchServer dispatchServer) Hooks into a server. -
Method Summary
Modifier and TypeMethodDescriptionstatic ServerHookGets the server hook instance.Gets all online players.voidregisterCommand(CommandHandler handler) Registers a command to theCommandMap.
-
Constructor Details
-
ServerHook
Hooks into a server.- Parameters:
gameServer- The game server to hook into.dispatchServer- The dispatch server to hook into.
-
-
Method Details
-
getInstance
Gets the server hook instance.- Returns:
- A
ServerHooksingleton.
-
getGameServer
- Returns:
- The game server.
-
getDispatchServer
- Returns:
- The dispatch server.
-
getOnlinePlayers
Gets all online players.- Returns:
- Players connected to the server.
-
registerCommand
Registers a command to theCommandMap.- Parameters:
handler- The command handler.
-