diff --git a/src/main/java/me/blackvein/quests/EventFactory.java b/src/main/java/me/blackvein/quests/EventFactory.java index 23e1d4d7e..7b89f2f35 100644 --- a/src/main/java/me/blackvein/quests/EventFactory.java +++ b/src/main/java/me/blackvein/quests/EventFactory.java @@ -1568,20 +1568,18 @@ public class EventFactory implements ConversationAbandonedListener { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("eventEditorMustSetMobAmountsFirst")); return new QuestMobPrompt(mobIndex, questMob); } - if (context.getSessionData(CK.E_MOB_TYPES) == null) { + if (context.getSessionData(CK.E_MOB_TYPES) == null || ((LinkedList) context.getSessionData(CK.E_MOB_TYPES)).isEmpty()) { LinkedList list = new LinkedList(); list.add(questMob.serialize()); context.setSessionData(CK.E_MOB_TYPES, list); } else { - if (((LinkedList) context.getSessionData(CK.E_MOB_TYPES)).isEmpty()) { - LinkedList list = new LinkedList(); - list.add(questMob.serialize()); - context.setSessionData(CK.E_MOB_TYPES, list); - } else { - LinkedList list = (LinkedList) context.getSessionData(CK.E_MOB_TYPES); + LinkedList list = (LinkedList) context.getSessionData(CK.E_MOB_TYPES); + if (mobIndex < list.size()) { list.set(mobIndex, questMob.serialize()); - context.setSessionData(CK.E_MOB_TYPES, list); + } else { + list.add(questMob.serialize()); } + context.setSessionData(CK.E_MOB_TYPES, list); } return new MobPrompt(); } else if (input.equalsIgnoreCase("16")) {