11package me.scoretwo.fastscript
22
3- import com.andreapivetta.kolor.*
43import me.scoretwo.fastscript.api.plugin.FastScriptMain
54import me.scoretwo.fastscript.api.script.ScriptManager
65import me.scoretwo.fastscript.commands.CommandManager
@@ -16,13 +15,14 @@ class FastScript(main: FastScriptMain) {
1615 val dataFolder = main.getDataFolder()
1716 val classLoader = main.getPluginClassLoader()
1817
19-
18+ fun hasPermission ( sender : Any , string : String ) = main.hasPermission(sender, string)
2019 fun setPlaceholder (player : Any , string : String ) = main.setPlaceholder(player, string)
2120 fun sendMessage (sender : Any , string : String , colorIndex : Boolean ) = main.sendMessage(sender, string, colorIndex)
2221 fun sendMessage (sender : Any , strings : Array <String >, colorIndex : Boolean ) = strings.forEach { main.sendMessage(sender, it, colorIndex) }
2322
2423 init {
2524 CONSOLE = main.CONSOLE
25+ printLogo()
2626 }
2727
2828 /* *
@@ -37,6 +37,7 @@ class FastScript(main: FastScriptMain) {
3737 main.onReload()
3838 initInternalScripts()
3939 scriptManager.loadScripts()
40+ commandManager.initCommands()
4041 }
4142
4243 /* *
@@ -65,7 +66,7 @@ class FastScript(main: FastScriptMain) {
6566 it[index] = String (line).replaceFirst(replace, " §${arrayOf(' 9' , ' b' , ' 3' ).random()}$replace §8" )
6667 }
6768 }
68- sendMessage(CONSOLE , it, false )
69+ CONSOLE . sendMessage(it )
6970 }
7071
7172 companion object {
@@ -154,4 +155,22 @@ class FastScript(main: FastScriptMain) {
154155
155156 }
156157
158+ }
159+
160+ enum class FormatHeader { INFO , WARN , ERROR , TIPS , HOOKED , DEBUG }
161+
162+ fun Any.hasPermission (string : String ): Boolean {
163+ return FastScript .instance.hasPermission(this , string)
164+ }
165+
166+ fun Any.sendMessage (string : String , colorIndex : Boolean = false) {
167+ FastScript .instance.sendMessage(this , string, colorIndex)
168+ }
169+
170+ fun Any.sendMessage (strings : Array <String >, colorIndex : Boolean = false) {
171+ FastScript .instance.sendMessage(this , strings, colorIndex)
172+ }
173+
174+ fun String.setPlaceholder (sender : Any ): String {
175+ return FastScript .instance.setPlaceholder(sender, this )
157176}
0 commit comments