2017-02-07 22:01:04 +01:00
|
|
|
package com.lenis0012.bukkit.marriage2.commands;
|
|
|
|
|
|
|
|
import com.lenis0012.bukkit.marriage2.Marriage;
|
|
|
|
import com.lenis0012.bukkit.marriage2.config.Message;
|
|
|
|
import com.lenis0012.bukkit.marriage2.config.Permissions;
|
|
|
|
import com.lenis0012.bukkit.marriage2.config.Settings;
|
|
|
|
import com.lenis0012.bukkit.marriage2.internal.MarriagePlugin;
|
|
|
|
import com.lenis0012.pluginutils.modules.configuration.ConfigurationModule;
|
2020-07-08 04:35:08 -07:00
|
|
|
import org.bukkit.ChatColor;
|
2017-02-07 22:01:04 +01:00
|
|
|
|
|
|
|
public class CommandReload extends Command {
|
|
|
|
|
|
|
|
public CommandReload(Marriage marriage) {
|
|
|
|
super(marriage, "reload");
|
|
|
|
|
|
|
|
// Command options
|
|
|
|
setDescription("Reload configuration settings");
|
|
|
|
setPermission(Permissions.RELOAD);
|
|
|
|
setAllowConsole(true);
|
|
|
|
setHidden(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void execute() {
|
2020-08-15 20:06:27 -05:00
|
|
|
if (!marriage.getTFM().isStaff(player))
|
2020-07-08 04:35:08 -07:00
|
|
|
{
|
|
|
|
sender.sendMessage(ChatColor.RED + "You are not permitted to use this command.");
|
|
|
|
return;
|
|
|
|
}
|
2017-02-07 22:01:04 +01:00
|
|
|
MarriagePlugin plugin = (MarriagePlugin) marriage.getPlugin();
|
|
|
|
ConfigurationModule module = plugin.getModule(ConfigurationModule.class);
|
|
|
|
module.reloadSettings(Settings.class, false);
|
|
|
|
reply(Message.CONFIG_RELOAD);
|
|
|
|
}
|
|
|
|
}
|