Check for bad split in Quests Journal

This commit is contained in:
PikaMug 2024-04-12 20:23:09 -04:00
parent 085cb1e53f
commit 00046d1dcb

View File

@ -101,8 +101,10 @@ public class BukkitQuestJournal {
builder.add(ChatColor.AQUA + BukkitItemUtil.getPrettyItemName(goal.getType().name())); builder.add(ChatColor.AQUA + BukkitItemUtil.getPrettyItemName(goal.getType().name()));
} }
} }
if (split.length > 1) {
builder.add(split[1]).newLine(); builder.add(split[1]).newLine();
} }
}
if (message.contains("<mob>") && objective.getGoalAsMob() != null) { if (message.contains("<mob>") && objective.getGoalAsMob() != null) {
split = message.split("<mob>"); split = message.split("<mob>");
builder.add(split[0]); builder.add(split[0]);
@ -114,8 +116,10 @@ public class BukkitQuestJournal {
} else { } else {
builder.add(BukkitMiscUtil.snakeCaseToUpperCamelCase(objective.getGoalAsMob().getEntityType().name())); builder.add(BukkitMiscUtil.snakeCaseToUpperCamelCase(objective.getGoalAsMob().getEntityType().name()));
} }
if (split.length > 1) {
builder.add(split[1]).newLine(); builder.add(split[1]).newLine();
} }
}
if (split == null) { if (split == null) {
builder.add(message).newLine(); builder.add(message).newLine();
} }