Add CommandHelper class & bump to 1.0.6
This commit is contained in:
@@ -6,7 +6,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "xyz.lncvrt"
|
group = "xyz.lncvrt"
|
||||||
version = "1.0.5"
|
version = "1.0.6"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|||||||
16
src/main/kotlin/xyz/lncvrt/galaxyapi/utils/CommandHelper.kt
Normal file
16
src/main/kotlin/xyz/lncvrt/galaxyapi/utils/CommandHelper.kt
Normal 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user