loot tracker: Use "an" prefix for monster names starting with vowels

This commit is contained in:
Jordan Atwood
2020-05-07 18:56:46 -07:00
committed by Adam
parent eae4e0b6a0
commit 116e1a0090

View File

@@ -167,6 +167,8 @@ public class LootTrackerPlugin extends Plugin
"H.A.M. Member", "Woman"
);
private static final Set<Character> VOWELS = ImmutableSet.of('a', 'e', 'i', 'o', 'u');
@Inject
private ClientToolbar clientToolbar;
@@ -403,7 +405,11 @@ public class LootTrackerPlugin extends Plugin
if (config.npcKillChatMessage())
{
lootReceivedChatMessage(items, "a " + name);
final String prefix = VOWELS.contains(Character.toLowerCase(name.charAt(0)))
? "an"
: "a";
lootReceivedChatMessage(items, prefix + ' ' + name);
}
}