feat: 调整基础类库加载

This commit is contained in:
coding
2017-12-28 08:28:13 +00:00
parent f164f7dd42
commit 9ef64d9bc2
5 changed files with 68 additions and 26 deletions

View File

@ -8,9 +8,9 @@
global.noop = function () {
};
loadCore();
loadExt();
loadRequire();
try {
loadExt();
loadServerLib();
loadPlugins();
} catch (ex) {
@ -43,8 +43,7 @@
* 加载补丁
*/
function loadExt() {
var fs = require('core/fs');
fs.list(fs.file(root, 'core/ext')).forEach(function (path) {
java.nio.file.Files.list(new java.io.File(root, 'core/ext').toPath()).forEach(function (path) {
console.log('加载扩展类库', path);
try {
load(path.toFile());
@ -59,7 +58,7 @@
}
/**
* 加载Bukkit的类库
* 加载系统类库
*/
function loadServerLib() {
var task = require('api/task');