Polished tab header footer & default command handling & other internal code

This commit is contained in:
LOOHP
2021-11-24 18:38:12 +00:00
parent a3b25de473
commit 6847f46a3b
14 changed files with 368 additions and 323 deletions
+3 -19
View File
@@ -37,7 +37,7 @@ import org.json.simple.parser.ParseException;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.loohp.limbo.commands.CommandSender;
import com.loohp.limbo.commands.Defaults;
import com.loohp.limbo.commands.DefaultCommands;
import com.loohp.limbo.consolegui.GUI;
import com.loohp.limbo.events.EventsManager;
import com.loohp.limbo.file.ServerProperties;
@@ -291,17 +291,8 @@ public class Limbo {
pluginFolder = new File("plugins");
pluginFolder.mkdirs();
// File defaultCommandsJar = new File(pluginFolder, "LimboDefaultCmd.jar");
// defaultCommandsJar.delete();
// console.sendMessage("Loading limbo default commands module...");
// try (InputStream in = Limbo.class.getClassLoader().getResourceAsStream("LimboDefaultCmd.jar")) {
// Files.copy(in, defaultCommandsJar.toPath());
// } catch (IOException e) {
// e.printStackTrace();
// }
pluginManager = new PluginManager(pluginFolder);
pluginManager = new PluginManager(new DefaultCommands(), pluginFolder);
try {
Method loadPluginsMethod = PluginManager.class.getDeclaredMethod("loadPlugins");
loadPluginsMethod.setAccessible(true);
@@ -323,9 +314,7 @@ public class Limbo {
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
Limbo.getInstance().terminate();
}));
console.sendMessage("Enabling Commands");
registerDefaultCommands();
console.sendMessage("Default Commands Enabled");
console.run();
}
@@ -415,11 +404,6 @@ public class Limbo {
}
}
public void registerDefaultCommands() {
LimboPlugin plug = new LimboPlugin();
getPluginManager().registerCommands(plug, new Defaults());
}
public ServerProperties getServerProperties() {
return properties;
}