type.allValues() does this for $monsters[]:
Code:
case DataTypes.TYPE_MONSTER:
this.addValues( list, MonsterDatabase.entrySet() );
MonsterDatabase.entrySet() does this:
Code:
return MonsterDatabase.MONSTER_DATA.entrySet();
MONSTER_DATA has this little feature:
Code:
if ( keyName.toLowerCase().startsWith( "the " ) )
{
// Some effects seem to sometimes remove The from the start of the monster name even if normally part of name
// eg. ELDRITCH HORROR Master Of Thieves
// So allow finding monster without the 'The' also
MonsterDatabase.MONSTER_DATA.put( keyName.substring( 4 ), monster );
MonsterDatabase.OLD_MONSTER_DATA.put( keyName.substring( 4 ).toLowerCase(), monster );
}
So, all "the" monsters appear twice in MONSTER_DATA - once with "the" and once without. Both point to the same MonsterData object.
Looks like when use the entryset to generate allValues, we should only use each MonsterData once. Or, perhaps we should just use the values(). ASH is the only user of MonsterDatabase.entrySet().