Changed /chestshop reload to work with new config

This commit is contained in:
Acrobot 2012-11-23 21:02:15 +01:00
parent 4252ede145
commit 3104ba1b48
1 changed files with 6 additions and 2 deletions

View File

@ -1,7 +1,9 @@
package com.Acrobot.ChestShop.Commands;
import com.Acrobot.Breeze.Configuration.Configuration;
import com.Acrobot.ChestShop.ChestShop;
import com.Acrobot.ChestShop.Config.Config;
import com.Acrobot.ChestShop.Configuration.Messages;
import com.Acrobot.ChestShop.Configuration.Properties;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
@ -13,7 +15,9 @@ import org.bukkit.command.CommandSender;
public class Version implements CommandExecutor {
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (args.length > 0 && args[0].equals("reload")) {
Config.setup();
Configuration.pairFileAndClass(ChestShop.loadFile("config.yml"), Properties.class);
Configuration.pairFileAndClass(ChestShop.loadFile("local.yml"), Messages.class);
sender.sendMessage(ChatColor.DARK_GREEN + "The config was reloaded.");
return true;
}