1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 05:55:27 +01:00

Potion and arrow recognition when crafting fix

This commit is contained in:
Zrips 2023-11-17 16:05:11 +02:00
parent 9254c8f3fb
commit 29d65dc3c4

View File

@ -789,10 +789,20 @@ public final class JobsPaymentListener implements Listener {
}
}
if (resultStack == null)
return;
while (newItemsCount > 0) {
newItemsCount--;
Jobs.action(jPlayer, new ItemActionInfo(resultStack, type));
if (resultStack.getItemMeta() instanceof PotionMeta) {
PotionMeta potion = (PotionMeta) resultStack.getItemMeta();
Jobs.action(jPlayer, new PotionItemActionInfo(resultStack, type, potion.getBasePotionData().getType()));
} else if (resultStack.hasItemMeta() && resultStack.getItemMeta().hasDisplayName()) {
Jobs.action(jPlayer, new ItemNameActionInfo(CMIChatColor.stripColor(resultStack.getItemMeta().getDisplayName()), type));
} else {
Jobs.action(jPlayer, new ItemActionInfo(resultStack, type));
}
}
}
}, 1);