npchighlight: factor out npc name tag checking
This commit is contained in:
@@ -385,17 +385,13 @@ public class NpcIndicatorsPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (String highlight : highlights)
|
if (highlightMatchesNPCName(npcName))
|
||||||
{
|
{
|
||||||
if (WildcardMatcher.matches(highlight, npcName))
|
highlightedNpcs.add(npc);
|
||||||
|
if (!client.isInInstancedRegion())
|
||||||
{
|
{
|
||||||
highlightedNpcs.add(npc);
|
memorizeNpc(npc);
|
||||||
if (!client.isInInstancedRegion())
|
spawnedNpcsThisTick.add(npc);
|
||||||
{
|
|
||||||
memorizeNpc(npc);
|
|
||||||
spawnedNpcsThisTick.add(npc);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -529,7 +525,6 @@ public class NpcIndicatorsPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
outer:
|
|
||||||
for (NPC npc : client.getNpcs())
|
for (NPC npc : client.getNpcs())
|
||||||
{
|
{
|
||||||
final String npcName = npc.getName();
|
final String npcName = npc.getName();
|
||||||
@@ -545,17 +540,14 @@ public class NpcIndicatorsPlugin extends Plugin
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (String highlight : highlights)
|
if (highlightMatchesNPCName(npcName))
|
||||||
{
|
{
|
||||||
if (WildcardMatcher.matches(highlight, npcName))
|
if (!client.isInInstancedRegion())
|
||||||
{
|
{
|
||||||
if (!client.isInInstancedRegion())
|
memorizeNpc(npc);
|
||||||
{
|
|
||||||
memorizeNpc(npc);
|
|
||||||
}
|
|
||||||
highlightedNpcs.add(npc);
|
|
||||||
continue outer;
|
|
||||||
}
|
}
|
||||||
|
highlightedNpcs.add(npc);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// NPC is not highlighted
|
// NPC is not highlighted
|
||||||
@@ -563,6 +555,19 @@ public class NpcIndicatorsPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean highlightMatchesNPCName(String npcName)
|
||||||
|
{
|
||||||
|
for (String highlight : highlights)
|
||||||
|
{
|
||||||
|
if (WildcardMatcher.matches(highlight, npcName))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private void validateSpawnedNpcs()
|
private void validateSpawnedNpcs()
|
||||||
{
|
{
|
||||||
if (skipNextSpawnCheck)
|
if (skipNextSpawnCheck)
|
||||||
|
|||||||
Reference in New Issue
Block a user