You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for (file in expansionFolder.listFiles() ?: arrayOf()) {
42
-
val expansionClass =try {
43
-
file.findClass(FastScriptExpansion::class.java)
44
-
} catch (e:Exception) {
45
-
e.printStackTrace()
46
-
plugin.server.console.sendMessage(FormatHeader.ERROR, "An exception occurred when loading extended ${file.name}, the reason:\n${e.message}")
47
-
continue
48
-
}
61
+
total++
62
+
val rawExpansion = fromFileExpansion(file)
49
63
50
-
if (expansionClass==null) {
51
-
plugin.server.console.sendMessage(FormatHeader.ERROR, "Unable to load the extension ${file.name} because it has no FastScriptExpansion class available!")
64
+
if (rawExpansion.first.type==ProcessResultType.FAILED) {
65
+
fail++
52
66
continue
53
67
}
54
68
55
69
try {
56
-
expansions.add(expansionClass.newInstance())
70
+
expansions.add(rawExpansion.second!!)
71
+
success++
57
72
} catch (e:Exception) {
58
73
e.printStackTrace()
59
-
plugin.server.console.sendMessage(FormatHeader.ERROR, "An exception occurred when loading extended ${file.name}, the reason:\n${e.message}")
74
+
plugin.server.console.sendMessage(FormatHeader.ERROR, "An exception occurred when loading extended ${file.name}, the reason:\n§8${e.stackTraceToString()}")
plugin.server.console.sendMessage(FormatHeader.ERROR, "An error occurred while loading the expansion '${file.name}' description file, the reason:\n§8${e.stackTraceToString()}")
plugin.server.console.sendMessage(FormatHeader.ERROR, "An error occurred while loading the main class ${description.main} of expansion '${file.name}', the reason:\n§8${e.stackTraceToString()}")
plugin.server.console.sendMessage(FormatHeader.ERROR, "An error occurred while loading the main class ${description.main} of expansion '${file.name}', the reason:\n§8${e.stackTraceToString()}")
plugin.server.console.sendMessage(FormatHeader.ERROR, "An error occurred while loading the main class ${description.main} of expansion '${file.name}', the reason: §cThe main class does not depend on FastScriptExpansion.")
plugin.server.console.sendMessage(FormatHeader.ERROR, "An exception occurred when loading extended '${file.name}', the reason:\n§8${e.stackTraceToString()}")
plugin.server.console.sendMessage(FormatHeader.ERROR, "Unable to load the extension '${file.name}' because it has no FastScriptExpansion class available!")
0 commit comments