mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-15 23:26:11 +01:00
Compare levels of Tipped Arrow, fixes #2228
This commit is contained in:
parent
94d55c3be7
commit
89a1b1eb70
@ -68,7 +68,6 @@ public class BukkitQuestadminNextstageCommand extends BukkitQuestsSubCommand {
|
||||
@Override
|
||||
public void execute(CommandSender cs, String[] args) {
|
||||
if (args.length < 3) {
|
||||
System.out.println(args.length);
|
||||
// Shows command usage
|
||||
return;
|
||||
}
|
||||
|
@ -64,11 +64,10 @@ public class BukkitItemListener implements Listener {
|
||||
if (!quester.meetsCondition(quest, true)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (quester.getCurrentQuests().containsKey(quest)
|
||||
&& quester.getCurrentStage(quest).containsObjective(type)) {
|
||||
if (BukkitInventoryUtil.getEmptySlots(player)
|
||||
< craftedItem.getAmount() / craftedItem.getMaxStackSize()) {
|
||||
if (craftedItem.getMaxStackSize() == 0 || (BukkitInventoryUtil.getEmptySlots(player)
|
||||
< craftedItem.getAmount() / craftedItem.getMaxStackSize())) {
|
||||
BukkitActionBarProvider.sendActionBar(player, ChatColor.RED + BukkitLang.get(player,
|
||||
"inventoryFull"));
|
||||
event.setCancelled(true);
|
||||
|
@ -77,7 +77,7 @@ public class BukkitItemUtil {
|
||||
* -6 if stack stored enchants are unequal<br>
|
||||
* -7 if stack item flags are unequal<br>
|
||||
* -8 if stack Written Book data is unequal<br>
|
||||
* -9 if stack Potion type is unequal<br>
|
||||
* -9 if stack Potion or Tipped Arrow type are unequal<br>
|
||||
* -10 if stack Tropical Fish variant is unequal
|
||||
*/
|
||||
public static int compareItems(final ItemStack one, final ItemStack two, final boolean ignoreAmount,
|
||||
@ -181,6 +181,14 @@ public class BukkitItemUtil {
|
||||
return -9;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (one.getType().name().equals("TIPPED_ARROW") && two.getType().name().equals("TIPPED_ARROW")) {
|
||||
final String levelA = BukkitItemUtil.getPrettyPotionLevel(one.getItemMeta());
|
||||
final String levelB = BukkitItemUtil.getPrettyPotionLevel(two.getItemMeta());
|
||||
if (!levelA.equals(levelB)) {
|
||||
return -9;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!one.getEnchantments().equals(two.getEnchantments())) {
|
||||
return -5;
|
||||
|
Loading…
Reference in New Issue
Block a user