Return custom for legacy reasons, fixes #1587

This commit is contained in:
PikaMug 2021-01-27 21:40:31 -05:00
parent a9e27768c4
commit 8383995cf8
2 changed files with 10 additions and 5 deletions

View File

@ -2740,6 +2740,9 @@ public class Quester implements Comparable<Quester> {
@SuppressWarnings("deprecation")
public void finishObjective(final Quest quest, final Objective objective, final EntityType mob, final String extra,
final NPC npc, final Location location, final DyeColor color, final String pass, final CustomObjective co) {
if (objective == null) {
return;
}
final Player p = getPlayer();
final ObjectiveType type = objective.getType();
final ItemStack increment = objective.getItemProgress() != null ? objective.getItemProgress()
@ -3094,6 +3097,9 @@ public class Quester implements Comparable<Quester> {
public void finishObjective(final Quest quest, final String objective, final ItemStack increment,
final ItemStack goal, final Enchantment enchantment, final EntityType mob, final String extra,
final NPC npc, final Location location, final DyeColor color, final String pass, final CustomObjective co) {
if (objective == null) {
return;
}
if (increment == null || goal == null) {
finishObjective(quest, new Objective(ObjectiveType.fromName(objective), 1, 1), mob, extra, npc,
location, color, pass, co);

View File

@ -67,12 +67,11 @@ public enum ObjectiveType {
if (name == null) {
return null;
}
// Adjust custom string for legacy reasons
String n = name.toLowerCase();
if (n.startsWith("custom")) {
n = "custom";
// Return custom for legacy reasons
if (name.startsWith("custom")) {
return CUSTOM;
}
return NAME_MAP.get(n);
return NAME_MAP.get(name.toLowerCase());
}
public static ObjectiveType fromId(final int id) {