BerndiVader / MythicMobsQuestsModule

MythicMobs Kill Objective for Quests Plugin
11 stars 12 forks source link

Latest Quests breaks this module due to new custom objective handling #35

Closed johnfriedrich closed 4 years ago

johnfriedrich commented 5 years ago

This commit seams to break this module: https://github.com/PikaMug/Quests/commit/666b9bd8bb0801849894fd3474534400422fe51c

Resulting NPE: https://pastebin.com/RCj1PLgy

https://github.com/BerndiVader/MythicMobsQuestsModule/blob/master/src/main/java/com/gmail/berndivader/mythicmobsquests/MythicMobsKillObjective.java#L67

At least pretty sure this breaks it as downgrading from latst dev to 3.6.5 helped

johnfriedrich commented 5 years ago

Thanks! Will report later if we have the chance to test it

PikaMug commented 5 years ago

Clearly I broke something, but I'm a little confused as to what's directly causing this (even looking at BerndiVader's fix). Any insight would be appreciated.

PikaMug commented 5 years ago

I was just able to produce an identical stack trace with module dev build 3. Using module dev build 4 (containing Berndi's fix) does not produce an error.

Still running blind as to why the change from get() to getOrDefault() was necessary (although it clearly was). If the datamap was returning null values, shouldn't this module's use of Optional.ofNullable suppressed any NPEs? Bear in mind I haven't taken to using Java 8's Optional class myself yet.

PikaMug commented 5 years ago

Looks like 6bd7f87 isn't a true solution. I was just able to complete a Kill MythicMobs objective with the Internal Name set to "Fairy" by killing a SkeletonKnight mob, so it seems to be defaulting to the "ANY" value (since killing a Fairy also works).

I've also just confirmed that the issue is with Quests, since DungeonsXLQuestsModule exhibited similar behavior in my testing. Hope to pinpoint the issue soon.

PikaMug commented 5 years ago

Fixed in https://github.com/PikaMug/Quests/commit/2e94a0f63d2e69580b849fb767cd18af72486879

johnfriedrich commented 5 years ago

What about the last commit in MythicMobsQuestModule? Is it working with that or should we use one version before that?

BerndiVader commented 5 years ago

Use the current builds of quests and the questsmodule. The issue is fixed. If you can confirm, close please.