summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPepich <benedikt.abel@yahoo.de>2017-03-24 10:56:57 +0100
committerPepich <benedikt.abel@yahoo.de>2017-03-24 10:56:57 +0100
commit0db0c9b5f6012d788b4e7562ccc672e1d3074921 (patch)
treec28077e737f10dce8cb7ffdb199051b376eec823
parent29460573f7b79eb3930a8e54ed6033a1095a1236 (diff)
Moved moduleloader cmd into seperate file; Prepared load cmd
-rw-r--r--src/com/redstoner/coremods/moduleLoader/ModuleLoader.cmd13
-rw-r--r--src/com/redstoner/coremods/moduleLoader/ModuleLoader.java25
2 files changed, 22 insertions, 16 deletions
diff --git a/src/com/redstoner/coremods/moduleLoader/ModuleLoader.cmd b/src/com/redstoner/coremods/moduleLoader/ModuleLoader.cmd
new file mode 100644
index 0000000..9dd5445
--- /dev/null
+++ b/src/com/redstoner/coremods/moduleLoader/ModuleLoader.cmd
@@ -0,0 +1,13 @@
+command modules {
+ list {
+ help Lists all modules. Color indicates status: §aENABLED §cDISABLED;
+ perm jutils.admin;
+ run list;
+ }
+ load [string:name...] {
+ help (Re)-Loads a module. WARNING: Handle with care! This has direct affect on code being executed. This command will temporarily halt the main thread until the class loading operation was completed.;
+ perm jtuils.admin;
+ run load name;
+ type console;
+ }
+} \ No newline at end of file
diff --git a/src/com/redstoner/coremods/moduleLoader/ModuleLoader.java b/src/com/redstoner/coremods/moduleLoader/ModuleLoader.java
index 0f170cf..ab0e3ec 100644
--- a/src/com/redstoner/coremods/moduleLoader/ModuleLoader.java
+++ b/src/com/redstoner/coremods/moduleLoader/ModuleLoader.java
@@ -1,5 +1,6 @@
package com.redstoner.coremods.moduleLoader;
+import java.io.File;
import java.util.HashMap;
import org.bukkit.Bukkit;
@@ -24,7 +25,7 @@ import com.redstoner.modules.Module;
/** The module loader, mother of all modules. Responsible for loading and taking care of all modules.
*
* @author Pepich */
-@Version(major = 3, minor = 0, revision = 1, compatible = 2)
+@Version(major = 3, minor = 1, revision = 0, compatible = 2)
public final class ModuleLoader implements CoreModule
{
private static ModuleLoader instance;
@@ -37,7 +38,8 @@ public final class ModuleLoader implements CoreModule
{
if (instance == null)
instance = new ModuleLoader();
- CommandManager.registerCommand(instance.getCommandString(), instance, Main.plugin);
+ CommandManager.registerCommand(ModuleLoader.class.getResourceAsStream("ModuleLoader.cmd"), instance,
+ Main.plugin);
}
/** This method will add a module to the module list, without enabling it
@@ -165,20 +167,6 @@ public final class ModuleLoader implements CoreModule
}
}
- // @noformat
- @Override
- public String getCommandString()
- {
- return "command modules {\n" +
- " list{\n" +
- " help Lists all modules. Color indicates status: §aENABLED §cDISABLED;\n" +
- " perm jutils.admin;\n" +
- " run list;\n" +
- " }\n" +
- "}";
- }
- // @format
-
/** This method lists all modules to the specified CommandSender. The modules will be color coded correspondingly to their enabled status.
*
* @param sender The person to send the info to, usually the issuer of the command or the console sender.
@@ -216,4 +204,9 @@ public final class ModuleLoader implements CoreModule
}
}
}
+
+ public static boolean loadModule(File f)
+ {
+ return false;
+ }
}