Effects, Hangover, Fixes

This commit is contained in:
Sn0wStorm
2013-05-28 16:25:06 +02:00
parent 5c82b08028
commit 84e37ec676
11 changed files with 553 additions and 235 deletions
+26 -10
View File
@@ -10,17 +10,16 @@ import org.bukkit.Material;
public class BRecipe {
private String[] name;
private Map<Material, Integer> ingredients = new HashMap<Material, Integer>();// material
// and
// amount
private Map<Material, Integer> ingredients = new HashMap<Material, Integer>();// material and amount
private int cookingTime;// time to cook in cauldron
private int distillruns;// runs through the brewer
private int 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;// Vol% of alcohol in perfect 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 String effect;// Special Effect
private int effectDur;// Duration of the special effect
public BRecipe(ConfigurationSection configSectionRecipes, String recipeId) {
String[] name = configSectionRecipes.getString(recipeId + ".name").split("/");
@@ -43,10 +42,18 @@ public class BRecipe {
this.color = configSectionRecipes.getString(recipeId + ".color");
this.difficulty = configSectionRecipes.getInt(recipeId + ".difficulty");
this.alcohol = configSectionRecipes.getInt(recipeId + ".alcohol");
String effectString = configSectionRecipes.getString(recipeId + ".effect");
if (effectString != null) {
String[] effectSplit = effectString.split("/");
this.effect = effectSplit[0];
if (effectSplit.length > 1) {
this.effectDur = P.p.parseInt(effectSplit[1]);
}
}
}
// allowed deviation to the recipes count of ingredients at the given
// difficulty
// allowed deviation to the recipes count of ingredients at the given difficulty
public int allowedCountDiff(int count) {
int allowedCountDiff = Math.round((float) ((11.0 - difficulty) * (count / 10.0)));
@@ -93,9 +100,9 @@ public class BRecipe {
public boolean needsDistilling() {
if (distillruns == 0) {
return true;
return false;
}
return false;
return true;
}
public boolean needsToAge() {
@@ -118,6 +125,7 @@ public class BRecipe {
return false;
}
// Getter
// how many of a specific ingredient in the recipe
@@ -181,4 +189,12 @@ public class BRecipe {
return alcohol;
}
public String getEffect() {
return effect;
}
public int getEffectDur() {
return effectDur;
}
}