Fixed removing commands on reload
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
command data {
|
command data {
|
||||||
import [string:file] as [string:module] {
|
import [string:file] as [string:module] {
|
||||||
run import_file file module;
|
run config_import_file file module;
|
||||||
type console;
|
type console;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,11 +11,11 @@ command config {
|
|||||||
alias settings;
|
alias settings;
|
||||||
perm datamanager.admin;
|
perm datamanager.admin;
|
||||||
list {
|
list {
|
||||||
run list;
|
run config_list;
|
||||||
help Lists all modules that have at least one config setting.;
|
help Lists all modules that have at least one config setting.;
|
||||||
}
|
}
|
||||||
list [string:module] {
|
list [string:module] {
|
||||||
run list2 module;
|
run config_list2 module;
|
||||||
help Lists all config settings of the specified module.;
|
help Lists all config settings of the specified module.;
|
||||||
}
|
}
|
||||||
get [string:module] [string:key] {
|
get [string:module] [string:key] {
|
||||||
@@ -23,11 +23,11 @@ command config {
|
|||||||
help Displays the value of the specified setting.;
|
help Displays the value of the specified setting.;
|
||||||
}
|
}
|
||||||
set [string:module] [string:key] [string:value...] {
|
set [string:module] [string:key] [string:value...] {
|
||||||
run set module key value;
|
run config_set module key value;
|
||||||
help Assigns a new value to the given setting.;
|
help Assigns a new value to the given setting.;
|
||||||
}
|
}
|
||||||
remove_all [string:module] {
|
remove_all [string:module] {
|
||||||
run remove_all module;
|
run config_remove_all module;
|
||||||
type console;
|
type console;
|
||||||
help Deletes all config settings of a given module.;
|
help Deletes all config settings of a given module.;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import com.redstoner.modules.Module;
|
|||||||
|
|
||||||
@Commands(CommandHolderType.Stream)
|
@Commands(CommandHolderType.Stream)
|
||||||
@AutoRegisterListener
|
@AutoRegisterListener
|
||||||
@Version(major = 4, minor = 1, revision = 8, compatible = 4)
|
@Version(major = 4, minor = 1, revision = 9, compatible = 4)
|
||||||
public final class DataManager implements CoreModule, Listener
|
public final class DataManager implements CoreModule, Listener
|
||||||
{
|
{
|
||||||
protected final File dataFolder = new File(Main.plugin.getDataFolder(), "data");
|
protected final File dataFolder = new File(Main.plugin.getDataFolder(), "data");
|
||||||
@@ -734,14 +734,14 @@ public final class DataManager implements CoreModule, Listener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command(hook = "list")
|
@Command(hook = "config_list")
|
||||||
public boolean list(CommandSender sender)
|
public boolean list(CommandSender sender)
|
||||||
{
|
{
|
||||||
getLogger().message(sender, Arrays.toString(module_index.toArray(new String[] {})));
|
getLogger().message(sender, Arrays.toString(module_index.toArray(new String[] {})));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command(hook = "list2")
|
@Command(hook = "config_list2")
|
||||||
public boolean list(CommandSender sender, String module)
|
public boolean list(CommandSender sender, String module)
|
||||||
{
|
{
|
||||||
Object o = config_data.get(module);
|
Object o = config_data.get(module);
|
||||||
@@ -764,7 +764,7 @@ public final class DataManager implements CoreModule, Listener
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command(hook = "get")
|
@Command(hook = "config_get")
|
||||||
public boolean get(CommandSender sender, String module, String key)
|
public boolean get(CommandSender sender, String module, String key)
|
||||||
{
|
{
|
||||||
getLogger().message(sender, new String[] {"§e" + module + "." + key + "§7 currently holds the value:",
|
getLogger().message(sender, new String[] {"§e" + module + "." + key + "§7 currently holds the value:",
|
||||||
@@ -772,7 +772,7 @@ public final class DataManager implements CoreModule, Listener
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command(hook = "set")
|
@Command(hook = "config_set")
|
||||||
public boolean set(CommandSender sender, String module, String key, String value)
|
public boolean set(CommandSender sender, String module, String key, String value)
|
||||||
{
|
{
|
||||||
if (setConfig_(module, key, value))
|
if (setConfig_(module, key, value))
|
||||||
@@ -787,7 +787,7 @@ public final class DataManager implements CoreModule, Listener
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command(hook = "remove_all")
|
@Command(hook = "config_remove_all")
|
||||||
public boolean remove_all(CommandSender sender, String module)
|
public boolean remove_all(CommandSender sender, String module)
|
||||||
{
|
{
|
||||||
if (removeAllConfig_(module))
|
if (removeAllConfig_(module))
|
||||||
|
|||||||
Reference in New Issue
Block a user