Add CommandHelper class & bump to 1.0.6

This commit is contained in:
2025-04-09 23:04:49 -07:00
parent a0150464c3
commit 96a809dcd3
2 changed files with 17 additions and 1 deletions

View File

@@ -6,7 +6,7 @@ plugins {
} }
group = "xyz.lncvrt" group = "xyz.lncvrt"
version = "1.0.5" version = "1.0.6"
repositories { repositories {
mavenCentral() mavenCentral()

View File

@@ -0,0 +1,16 @@
package xyz.lncvrt.galaxyapi.utils
import org.bukkit.entity.Player
import xyz.lncvrt.galaxyapi.GalaxyAPI
@Suppress("unused")
class CommandHelper {
fun executeAsPlayer(player: Player, command: String) {
player.performCommand(command)
}
fun executeAsConsole(command: String) {
val instance = GalaxyAPI.getInstance()
instance.server.dispatchCommand(instance.server.consoleSender, command)
}
}