0

Moved moduleloader cmd into seperate file; Prepared load cmd

This commit is contained in:
Pepich 2017-03-24 10:56:57 +01:00
parent 29460573f7
commit 0db0c9b5f6
2 changed files with 22 additions and 16 deletions

View File

@ -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;
}
}

View File

@ -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;
}
}