Added recipe option to set Distill Time

This commit is contained in:
Sn0wStorm
2016-06-28 21:01:47 +02:00
parent bd6742a599
commit 49efceaaae
8 changed files with 189 additions and 66 deletions
+24 -14
View File
@@ -12,14 +12,15 @@ import java.util.List;
public class BRecipe {
private String[] name;
private ArrayList<ItemStack> ingredients = new ArrayList<>();// material and amount
private int cookingTime;// time to cook in cauldron
private int distillruns;// runs through the brewer
private byte wood;// type of wood the barrel has to consist of
private int age;// time in minecraft days for the potions to age in barrels
private String color;// color of the destilled/finished potion
private int difficulty;// difficulty to brew the potion, how exact the instruction has to be followed
private int alcohol;// Alcohol in perfect potion
private ArrayList<ItemStack> ingredients = new ArrayList<>(); // material and amount
private int cookingTime; // time to cook in cauldron
private int distillruns; // runs through the brewer
private int distillTime; // time for one distill run in seconds
private byte wood; // type of wood the barrel has to consist of
private int age; // time in minecraft days for the potions to age in barrels
private String color; // color of the destilled/finished potion
private int difficulty; // difficulty to brew the potion, how exact the instruction has to be followed
private int alcohol; // Alcohol in perfect potion
private ArrayList<BEffect> effects = new ArrayList<>(); // Special Effects when drinking
public BRecipe(ConfigurationSection configSectionRecipes, String recipeId) {
@@ -88,13 +89,14 @@ public class BRecipe {
}
}
}
this.cookingTime = configSectionRecipes.getInt(recipeId + ".cookingtime");
this.distillruns = configSectionRecipes.getInt(recipeId + ".distillruns");
this.wood = (byte) configSectionRecipes.getInt(recipeId + ".wood");
this.age = configSectionRecipes.getInt(recipeId + ".age");
this.cookingTime = configSectionRecipes.getInt(recipeId + ".cookingtime", 1);
this.distillruns = configSectionRecipes.getInt(recipeId + ".distillruns", 0);
this.distillTime = configSectionRecipes.getInt(recipeId + ".distilltime", 0) * 20;
this.wood = (byte) configSectionRecipes.getInt(recipeId + ".wood", 0);
this.age = configSectionRecipes.getInt(recipeId + ".age", 0);
this.color = configSectionRecipes.getString(recipeId + ".color");
this.difficulty = configSectionRecipes.getInt(recipeId + ".difficulty");
this.alcohol = configSectionRecipes.getInt(recipeId + ".alcohol");
this.difficulty = configSectionRecipes.getInt(recipeId + ".difficulty", 0);
this.alcohol = configSectionRecipes.getInt(recipeId + ".alcohol", 0);
List<String> effectStringList = configSectionRecipes.getStringList(recipeId + ".effects");
if (effectStringList != null) {
@@ -131,6 +133,10 @@ public class BRecipe {
P.p.errorLog("Invalid distillruns '" + distillruns + "' in Recipe: " + getName(5));
return false;
}
if (distillTime < 0) {
P.p.errorLog("Invalid distilltime '" + distillTime + "' in Recipe: " + getName(5));
return false;
}
if (wood < 0 || wood > 6) {
P.p.errorLog("Invalid wood type '" + wood + "' in Recipe: " + getName(5));
return false;
@@ -316,6 +322,10 @@ public class BRecipe {
return distillruns;
}
public int getDistillTime() {
return distillTime;
}
public String getColor() {
if (color != null) {
return color.toUpperCase();