@@ -3,39 +3,49 @@ package me.scoretwo.fastscript
33import com.andreapivetta.kolor.*
44import me.scoretwo.fastscript.api.plugin.FastScriptMain
55import me.scoretwo.fastscript.api.script.ScriptManager
6+ import me.scoretwo.fastscript.commands.CommandManager
67import java.io.File
78
89class FastScript (main : FastScriptMain ) {
910
1011 private val main: FastScriptMain = main
1112
1213 val scriptManager = ScriptManager ()
14+ val commandManager = CommandManager ()
1315
1416 val dataFolder = main.getDataFolder()
1517 val classLoader = main.getPluginClassLoader()
18+
19+
1620 fun setPlaceholder (player : Any , string : String ) = main.setPlaceholder(player, string)
1721 fun sendMessage (sender : Any , string : String , colorIndex : Boolean ) = main.sendMessage(sender, string, colorIndex)
22+ fun sendMessage (sender : Any , strings : Array <String >, colorIndex : Boolean ) = strings.forEach { main.sendMessage(sender, it, colorIndex) }
1823
1924 init {
2025 CONSOLE = main.CONSOLE
2126 }
2227
28+ /* *
29+ * 初始化内置脚本
30+ * 暂时弃坑
31+ */
2332 fun initInternalScripts () {
2433
2534 }
2635
2736 fun onReload () {
2837 main.onReload()
2938 initInternalScripts()
39+ scriptManager.loadScripts()
3040 }
3141
3242 /* *
33- * 用于随机点亮 FastScript 的 Logo
43+ * 用于随机点亮 FastScript 的 Logo.
3444 * 该创意来源于 TrMenu
3545 * @author Arasple
3646 */
3747
38- fun printLogo () = mutableListOf (
48+ fun printLogo () = arrayOf (
3949 " ___________ __ _________ .__ __ " ,
4050 " \\ _ _____/____ _______/ |_/ _____/ ___________|__|______/ |_ " ,
4151 " | __) \\ __ \\ / ___/\\ __\\ _____ \\ _/ ___\\ _ __ \\ \\ ____ \\ __\\ " ,
@@ -55,13 +65,13 @@ class FastScript(main: FastScriptMain) {
5565 it[index] = String (line).replaceFirst(replace, " §${arrayOf(' 9' , ' b' , ' 3' ).random()}$replace §8" )
5666 }
5767 }
58- printColors(it )
68+ sendMessage( CONSOLE , it, false )
5969 }
6070
6171 companion object {
6272 lateinit var instance: FastScript
6373 var CONSOLE = Any ()
64-
74+ /*
6575 @JvmStatic
6676 fun main(args: Array<out String>) {
6777
@@ -124,10 +134,14 @@ class FastScript(main: FastScriptMain) {
124134 }
125135 println()
126136 }
137+ */
127138
128139 fun sendMessage (sender : Any , string : String , colorIndex : Boolean = false) {
129140 instance.sendMessage(sender, string, colorIndex)
130141 }
142+ fun sendMessage (sender : Any , strings : Array <String >, colorIndex : Boolean = false) {
143+ instance.sendMessage(sender, strings, colorIndex)
144+ }
131145
132146 fun setBootstrap (main : FastScriptMain ) {
133147 if (instance != null ) {
0 commit comments