mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-30 22:53: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));
|
ItemStack is = getCurrentStage(quest).itemsToBrew.get(getCurrentStage(quest).itemsToBrew.indexOf(goal));
|
||||||
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "brew") + " <item> "
|
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "brew") + " <item> "
|
||||||
+ is.getAmount() + "/" + is.getAmount();
|
+ is.getAmount() + "/" + is.getAmount();
|
||||||
if (plugin.getSettings().canTranslateItems() && !increment.hasItemMeta()
|
if (plugin.getSettings().canTranslateItems() && goal.hasItemMeta()
|
||||||
&& !increment.getItemMeta().hasDisplayName()) {
|
&& !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 {
|
} else {
|
||||||
p.sendMessage(message.replace("<item>", ItemUtil.getName(is)));
|
p.sendMessage(message.replace("<item>", ItemUtil.getName(is)));
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@ public class ItemUtil {
|
|||||||
// Bukkit version is 1.9+
|
// Bukkit version is 1.9+
|
||||||
if (one.getType().equals(Material.POTION) || one.getType().equals(Material.LINGERING_POTION) || one.getType().equals(Material.SPLASH_POTION)) {
|
if (one.getType().equals(Material.POTION) || one.getType().equals(Material.LINGERING_POTION) || one.getType().equals(Material.SPLASH_POTION)) {
|
||||||
PotionMeta pmeta1 = (PotionMeta) one.getItemMeta();
|
PotionMeta pmeta1 = (PotionMeta) one.getItemMeta();
|
||||||
PotionMeta pmeta2 = (PotionMeta) one.getItemMeta();
|
PotionMeta pmeta2 = (PotionMeta) two.getItemMeta();
|
||||||
if (pmeta1.getBasePotionData().getType().equals(pmeta2.getBasePotionData().getType()) == false) {
|
if (pmeta1.getBasePotionData().getType().equals(pmeta2.getBasePotionData().getType()) == false) {
|
||||||
return -9;
|
return -9;
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,8 @@ public class LocaleQuery {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (meta != null && meta instanceof PotionMeta) {
|
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()) {
|
if (enchantments != null && !enchantments.isEmpty()) {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user