mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-28 05:35:33 +01:00
Correct comparison of some Potion types, fixes #952
This commit is contained in:
parent
5739ce80a9
commit
79f97e8c98
@ -2165,9 +2165,10 @@ public class Quester {
|
||||
ItemStack is = getCurrentStage(quest).itemsToBrew.get(getCurrentStage(quest).itemsToBrew.indexOf(goal));
|
||||
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "brew") + " <item> "
|
||||
+ is.getAmount() + "/" + is.getAmount();
|
||||
if (plugin.getSettings().canTranslateItems() && !increment.hasItemMeta()
|
||||
if (plugin.getSettings().canTranslateItems() && goal.hasItemMeta()
|
||||
&& !increment.getItemMeta().hasDisplayName()) {
|
||||
plugin.getLocaleQuery().sendMessage(p, message, goal.getType(), goal.getDurability(), null);
|
||||
plugin.getLocaleQuery().sendMessage(p, message, goal.getType(), goal.getDurability(), null,
|
||||
goal.getItemMeta());
|
||||
} else {
|
||||
p.sendMessage(message.replace("<item>", ItemUtil.getName(is)));
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ public class ItemUtil {
|
||||
// Bukkit version is 1.9+
|
||||
if (one.getType().equals(Material.POTION) || one.getType().equals(Material.LINGERING_POTION) || one.getType().equals(Material.SPLASH_POTION)) {
|
||||
PotionMeta pmeta1 = (PotionMeta) one.getItemMeta();
|
||||
PotionMeta pmeta2 = (PotionMeta) one.getItemMeta();
|
||||
PotionMeta pmeta2 = (PotionMeta) two.getItemMeta();
|
||||
if (pmeta1.getBasePotionData().getType().equals(pmeta2.getBasePotionData().getType()) == false) {
|
||||
return -9;
|
||||
}
|
||||
|
@ -137,7 +137,8 @@ public class LocaleQuery {
|
||||
return false;
|
||||
}
|
||||
if (meta != null && meta instanceof PotionMeta) {
|
||||
matKey = "item.minecraft.potion.effect." + ((PotionMeta)meta).getBasePotionData().getType().name().toLowerCase();
|
||||
matKey = "item.minecraft.potion.effect." + ((PotionMeta)meta).getBasePotionData().getType().name().toLowerCase()
|
||||
.replace("regen", "regeneration").replace("speed", "swiftness");
|
||||
}
|
||||
if (enchantments != null && !enchantments.isEmpty()) {
|
||||
int count = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user