Skip to content

Commit

Permalink
Ignore empty items in craft listener
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSzabo committed Dec 15, 2024
1 parent be0c733 commit 256988b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/gg/auroramc/quests/listener/CraftListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ private static int calculateCraftAmount(final CraftItemEvent event) {
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onCraftItem(CraftItemEvent event) {
if (event.getWhoClicked() instanceof final Player player) {
var amount = calculateCraftAmount(event);
var item = event.getRecipe().getResult();
if (item.isEmpty()) return;
var amount = calculateCraftAmount(event);
AuroraQuests.getInstance().getQuestManager().progress(player, TaskType.CRAFT, amount, Map.of("type", AuroraAPI.getItemManager().resolveId(item)));
}
}
Expand Down

0 comments on commit 256988b

Please sign in to comment.