Errorhandling for Recipeloading

This commit is contained in:
Sn0wStorm
2013-09-05 23:02:45 +02:00
parent 07a9778c8b
commit c691fea1ee
3 changed files with 41 additions and 12 deletions
+6 -1
View File
@@ -161,7 +161,12 @@ public class P extends JavaPlugin {
ConfigurationSection configSection = config.getConfigurationSection("recipes");
if (configSection != null) {
for (String recipeId : configSection.getKeys(false)) {
BIngredients.recipes.add(new BRecipe(configSection, recipeId));
BRecipe recipe = new BRecipe(configSection, recipeId);
if (recipe.isValid()) {
BIngredients.recipes.add(recipe);
} else {
errorLog("Recipe with id: '" + recipeId + "' failed to load!");
}
}
}