Added Cmd Reload

This commit is contained in:
Sn0wStorm
2013-07-29 18:54:40 +02:00
parent 3eb8bf7a0e
commit 7a236a4297
2 changed files with 25 additions and 3 deletions
+22 -1
View File
@@ -79,11 +79,32 @@ public class P extends JavaPlugin {
// Stop shedulers
p.getServer().getScheduler().cancelTasks(this);
// save Data to Disk
saveData();
// delete Data from Ram
Barrel.barrels.clear();
BCauldron.bcauldrons.clear();
BIngredients.possibleIngredients.clear();
BIngredients.recipes.clear();
BIngredients.cookedNames.clear();
BPlayer.players.clear();
Brew.potions.clear();
Wakeup.wakeups.clear();
Words.words.clear();
this.log(this.getDescription().getName() + " disabled!");
}
public void reload() {
BIngredients.possibleIngredients.clear();
BIngredients.recipes.clear();
BIngredients.cookedNames.clear();
Words.words.clear();
readConfig();
}
public void msg(CommandSender sender, String msg) {
sender.sendMessage(ChatColor.DARK_GREEN + "[Brewery] " + ChatColor.WHITE + msg);
}
@@ -109,7 +130,7 @@ public class P extends JavaPlugin {
if (!file.exists()) {
saveDefaultConfig();
}
FileConfiguration config = getConfig();
FileConfiguration config = YamlConfiguration.loadConfiguration(file);
// various Settings
autosave = config.getInt("autosave", 3);