Account for incompatible mob targets, fixes #117. Bump version number

This commit is contained in:
HappyPikachu 2017-12-21 02:04:10 -05:00
parent c670fbebc2
commit 143fae7b84
2 changed files with 13 additions and 9 deletions

View File

@ -3,7 +3,7 @@
<groupId>me.blackvein.quests</groupId> <groupId>me.blackvein.quests</groupId>
<artifactId>quests</artifactId> <artifactId>quests</artifactId>
<version>3.1.5</version> <version>3.1.6</version>
<name>quests</name> <name>quests</name>
<url>https://github.com/FlyingPikachu/Quests/</url> <url>https://github.com/FlyingPikachu/Quests/</url>
<packaging>jar</packaging> <packaging>jar</packaging>

View File

@ -2451,16 +2451,20 @@ public class CreateStagePrompt extends FixedSetPrompt {
@Override @Override
public String getPromptText(ConversationContext context) { public String getPromptText(ConversationContext context) {
String mobs = ChatColor.LIGHT_PURPLE + Lang.get("eventEditorMobsTitle") + "\n"; String mobs = ChatColor.LIGHT_PURPLE + Lang.get("eventEditorMobsTitle") + "\n";
final EntityType[] mobArr = EntityType.values(); LinkedList<EntityType> mobArr = new LinkedList<EntityType>(Arrays.asList(EntityType.values()));
for (int i = 0; i < mobArr.length; i++) { LinkedList<EntityType> toRemove = new LinkedList<EntityType>();
final EntityType type = mobArr[i]; for (int i = 0; i < mobArr.size(); i++) {
if (type.isAlive() == false) { final EntityType type = mobArr.get(i);
continue; if (type.isAlive() == false || type.name().equals("PLAYER")) {
toRemove.add(type);
} }
if (i < (mobArr.length - 1)) { }
mobs += MiscUtil.getProperMobName(mobArr[i]) + ", "; mobArr.removeAll(toRemove);
for (int i = 0; i < mobArr.size(); i++) {
if (i < (mobArr.size() - 1)) {
mobs += MiscUtil.getProperMobName(mobArr.get(i)) + ", ";
} else { } else {
mobs += MiscUtil.getProperMobName(mobArr[i]) + "\n"; mobs += MiscUtil.getProperMobName(mobArr.get(i)) + "\n";
} }
} }
return mobs + ChatColor.YELLOW + Lang.get("stageEditorMobsPrompt"); return mobs + ChatColor.YELLOW + Lang.get("stageEditorMobsPrompt");