From 629c80b2a0ebffa39c9ba76eb6c1a73dd863a1d1 Mon Sep 17 00:00:00 2001 From: HappyPikachu Date: Wed, 29 Apr 2015 21:29:11 -0400 Subject: [PATCH] Add debug for #93 --- .gitignore | 3 ++- .../java/me/blackvein/quests/Quester.java | 19 ++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 93fbbef4f..1b26172d4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ # Ignore IDEA files /.idea -*.iml \ No newline at end of file +*.iml +/bin/ diff --git a/src/main/java/me/blackvein/quests/Quester.java b/src/main/java/me/blackvein/quests/Quester.java index a681161ac..21d41ffe7 100644 --- a/src/main/java/me/blackvein/quests/Quester.java +++ b/src/main/java/me/blackvein/quests/Quester.java @@ -666,11 +666,20 @@ public class Quester { } for (ItemStack is : getCurrentStage(quest).itemsToDeliver) { - - int delivered = getQuestData(quest).itemsDelivered.get(is); - int amt = is.getAmount(); - Integer npc = getCurrentStage(quest).itemDeliveryTargets.get(getCurrentStage(quest).itemsToDeliver.indexOf(is)); - + + int delivered = 999; + int amt = 999; + Integer npc = null; + try { + delivered = getQuestData(quest).itemsDelivered.get(is); + amt = is.getAmount(); + npc = getCurrentStage(quest).itemDeliveryTargets.get(getCurrentStage(quest).itemsToDeliver.indexOf(is)); + } catch (Exception e) { + plugin.getLogger().severe("Issue grabbing data. Please report these values in Github ticket #93:"); + plugin.getLogger().severe("quest = " + quest.name + ", delivered = " + delivered + ", amt = " + amt + ", npc = " + npc); + e.printStackTrace(); + } + if (delivered < amt) { String obj = Lang.get("deliver");