1- package com.pixlfox.scriptablemc
1+ package com.pixlfox.scriptablemc.js
22
33import co.aikar.commands.PaperCommandManager
4+ import com.pixlfox.scriptablemc.PluginEngineCommands
5+ import com.pixlfox.scriptablemc.PluginEngineMain
46import com.pixlfox.scriptablemc.core.JavaScriptPluginEngine
57import org.bukkit.ChatColor
68import org.bukkit.command.CommandSender
79
810
911@Suppress(" unused" )
10- class SMCJavaScriptEngineMain : ScriptEngineMain () {
12+ class JavaScriptPluginEngineMain : PluginEngineMain () {
1113 override val chatMessagePrefix = " ${ChatColor .GRAY } [${ChatColor .DARK_AQUA } ScriptableMC-JS${ChatColor .GRAY } ]${ChatColor .RESET } "
1214 override val scriptLanguage = " js"
1315
@@ -19,8 +21,8 @@ class SMCJavaScriptEngineMain : ScriptEngineMain() {
1921 registerScriptEngine(scriptLanguage, this )
2022
2123 commandManager = PaperCommandManager (this )
22- commandManager?.registerCommand(ScriptEngineGlobalCommands (this ))
23- commandManager?.registerCommand(SMCJavaScriptEngineCommands (this ), true )
24+ commandManager?.registerCommand(PluginEngineCommands (this ))
25+ commandManager?.registerCommand(JavaScriptPluginEngineCommands (this ), true )
2426
2527 saveDefaultConfig()
2628 loadScriptEngine()
@@ -51,7 +53,7 @@ class SMCJavaScriptEngineMain : ScriptEngineMain() {
5153 versionCheck()
5254 patchClassLoader(javaClass) {
5355 try {
54- scriptEngine = JavaScriptPluginEngine (this , SMCJavaScriptConfig (config))
56+ scriptEngine = JavaScriptPluginEngine (this , JavaScriptPluginEngineConfig (config))
5557 scriptEngine!! .start()
5658 if (scriptEngine!! .startupErrors.any()) {
5759 for (error in scriptEngine!! .startupErrors) {
@@ -95,7 +97,7 @@ class SMCJavaScriptEngineMain : ScriptEngineMain() {
9597 }
9698
9799 companion object {
98- var instance: SMCJavaScriptEngineMain ? = null
100+ var instance: JavaScriptPluginEngineMain ? = null
99101 private set
100102 }
101103}
0 commit comments