-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add executeCommand extension for server * reformat server executeCommand extension * add docs for the core.server package Co-authored-by: Jakob K <[email protected]>
- Loading branch information
Showing
3 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
silk-core/src/main/kotlin/net/silkmc/silk/core/server/ServerExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package net.silkmc.silk.core.server | ||
|
||
import net.minecraft.server.MinecraftServer | ||
|
||
/** | ||
* Executes the given [command] for this server. | ||
* | ||
* Note that the [command] must not contain the slash prefix. | ||
*/ | ||
fun MinecraftServer.executeCommand(command: String) { | ||
commands.performCommand(createCommandSourceStack(), command) | ||
} |