Check if input is a water bottle first

This commit is contained in:
TfT_02 2014-06-09 22:55:03 +02:00
parent b107a8dc7c
commit 1becc874ba

View File

@ -33,13 +33,17 @@ public enum PotionStage {
public static PotionStage getPotionStage(AlchemyPotion input, AlchemyPotion output) { public static PotionStage getPotionStage(AlchemyPotion input, AlchemyPotion output) {
PotionStage potionStage = getPotionStage(output); PotionStage potionStage = getPotionStage(output);
if (getPotionStage(input) == potionStage) { if (!isWaterBottle(input) && getPotionStage(input) == potionStage) {
potionStage = PotionStage.FIVE; potionStage = PotionStage.FIVE;
} }
return potionStage; return potionStage;
} }
private static boolean isWaterBottle(AlchemyPotion input) {
return input.getEffects().isEmpty();
}
public static PotionStage getPotionStage(AlchemyPotion alchemyPotion) { public static PotionStage getPotionStage(AlchemyPotion alchemyPotion) {
Potion potion = Potion.fromItemStack(new ItemStack(Material.POTION, 1, alchemyPotion.getDataValue())); Potion potion = Potion.fromItemStack(new ItemStack(Material.POTION, 1, alchemyPotion.getDataValue()));