Update Alchemy for 1.9 Configuration style has changed, but theoretically old version should still work I think.

This commit is contained in:
t00thpick1
2016-03-01 17:05:58 -05:00
parent f77ae6ee15
commit f52d9feef8
4 changed files with 85 additions and 27 deletions

View File

@ -36,7 +36,7 @@ public final class AlchemyPotionBrewer {
continue;
}
if (getChildPotion(PotionConfig.getInstance().getPotion(contents[i].getDurability()), contents[Alchemy.INGREDIENT_SLOT]) != null) {
if (getChildPotion(PotionConfig.getInstance().getPotion(contents[i]), contents[Alchemy.INGREDIENT_SLOT]) != null) {
return true;
}
}
@ -45,8 +45,8 @@ public final class AlchemyPotionBrewer {
}
private static AlchemyPotion getChildPotion(AlchemyPotion potion, ItemStack ingredient) {
if (potion != null && potion.getChildDataValue(ingredient) != -1) {
return PotionConfig.getInstance().getPotion(potion.getChildDataValue(ingredient));
if (potion != null) {
return potion.getChild(ingredient);
}
return null;
@ -118,8 +118,8 @@ public final class AlchemyPotionBrewer {
continue;
}
AlchemyPotion input = PotionConfig.getInstance().getPotion(item.getDurability());
AlchemyPotion output = PotionConfig.getInstance().getPotion(input.getChildDataValue(ingredient));
AlchemyPotion input = PotionConfig.getInstance().getPotion(item);
AlchemyPotion output = input.getChild(ingredient);
inputList.add(input);
@ -138,7 +138,7 @@ public final class AlchemyPotionBrewer {
removeIngredient(inventory, player);
for (AlchemyPotion input : inputList) {
AlchemyPotion output = PotionConfig.getInstance().getPotion(input.getChildDataValue(ingredient));
AlchemyPotion output = input.getChild(ingredient);
if (output != null && player != null) {
PotionStage potionStage = PotionStage.getPotionStage(input, output);