0

Added /modules -v + compilation fixes #9

Merged
davidpanic merged 4 commits from dev into master 2019-04-17 18:00:11 +00:00
5 changed files with 41 additions and 6 deletions

1
.gitignore vendored
View File

@ -123,6 +123,7 @@ hs_err_pid*
### Gradle ### ### Gradle ###
.gradle .gradle
build/ build/
bin/
# Ignore Gradle GUI config # Ignore Gradle GUI config
gradle-app.setting gradle-app.setting

View File

@ -36,4 +36,16 @@ jar {
task sourceJar(type: Jar, dependsOn: classes) { task sourceJar(type: Jar, dependsOn: classes) {
classifier 'sources' classifier 'sources'
from sourceSets.main.allSource from sourceSets.main.allSource
}
sourceSets {
main {
resources {
srcDir 'src/main/java'
include '**/*.cmd'
srcDir 'src/main/resources'
include '**/*.yml'
}
}
} }

View File

@ -4,10 +4,22 @@ command modules {
perm moduleloader.modules.list; perm moduleloader.modules.list;
run list; run list;
} }
-v {
help Lists all modules and their versions. Color indicates status: §aENABLED §cDISABLED;
perm moduleloader.modules.list;
run listversions;
}
list { list {
help Lists all modules. Color indicates status: §aENABLED §cDISABLED; help Lists all modules. Color indicates status: §aENABLED §cDISABLED;
perm moduleloader.modules.list; perm moduleloader.modules.list;
run list; run list;
}
list -v {
help Lists all modules and their versions. Color indicates status: §aENABLED §cDISABLED;
perm moduleloader.modules.list;
run listversions;
} }
load [string:name...] { 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.; 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.;

View File

@ -561,15 +561,25 @@ public final class ModuleLoader implements CoreModule {
return Main.plugin; return Main.plugin;
} }
@Command (hook = "list", async = AsyncType.ALWAYS)
public boolean listModulesCommand(CommandSender sender) {
return listModules(sender, false);
}
@Command (hook = "listversions", async = AsyncType.ALWAYS)
public boolean listModulesVerionsCommand(CommandSender sender) {
return listModules(sender, true);
}
/** /**
* This method lists all modules to the specified CommandSender. The modules will be color coded correspondingly to their enabled status. * 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. * @param sender The person to send the info to, usually the issuer of the command or the console sender.
* @param showVersions Should we show the versions directly in chat.
* *
* @return true. * @return true.
*/ */
@Command (hook = "list", async = AsyncType.ALWAYS) public boolean listModules(CommandSender sender, boolean showVersions) {
public boolean listModulesCommand(CommandSender sender) {
boolean hasCategorys = hasCategories(); boolean hasCategorys = hasCategories();
Message m = new Message(sender, null); Message m = new Message(sender, null);
ModuleInfo ml_info = moduleInfos.get(instance); ModuleInfo ml_info = moduleInfos.get(instance);
@ -587,7 +597,7 @@ public final class ModuleLoader implements CoreModule {
for (Module mod : mods) { for (Module mod : mods) {
ModuleInfo info = moduleInfos.get(mod); ModuleInfo info = moduleInfos.get(mod);
m.appendTextHover((modules.get(mod) ? "§a" : "§c") + info.getDisplayName(), info.getModuleInfoHover()); m.appendTextHover((modules.get(mod) ? "§a" : "§c") + info.getDisplayName() + (showVersions ? " &e" + info.getVersion() : ""), info.getModuleInfoHover());
if (curModule != mods.size()) if (curModule != mods.size())
m.appendText("&7, "); m.appendText("&7, ");

View File

@ -1,5 +1,5 @@
name: ModuleLoader name: ModuleLoader
version: 5.2.1 version: 5.2.2
authors: [pepich1851] authors: [pepich1851, psrcek, LogalDeveloper, Minenash]
main: com.redstoner.misc.Main main: com.redstoner.misc.Main
softdepend: [Vault] softdepend: [Vault]