OpenMods / OpenPeripheral-Integration

Extra OP adapters
MIT License
9 stars 9 forks source link

AdapterBeeHousing.listAllSpecies() doesn't not report prime species #26

Closed secondfry closed 8 years ago

secondfry commented 8 years ago

Setup information:

Mod Version Latest?
Forestry 4.2.11.59 No (according to Forestry page)
Extra Bees 2.0-pre14 Yes (according to Binnies Mods page)
Magic Bees 1.7.10-2.4.3 Yes (according to Magic Bees page)
OpenPeripheralIntegration 0.5 (build 90) Yes (according to Jenkins)

Examples of prime species:

Mod Species Origin
Forestry Meadows, Forest, etc. Worldgen hives
Forestry Monastic Dangeon loot or Villager trade
Magic Bees Mystical, Sorcerous, Unusual, Attuned, Oblivion, Infernal Worldgen hives
Extra Bees Water, Rocky, Embittered Worldgen hives

Code in question: https://github.com/OpenMods/OpenPeripheral-Integration/blob/master/src/main/java/openperipheral/integration/forestry/AdapterBeeHousing.java#L95

@ScriptCallable(returnTypes = ReturnType.TABLE, description = "Get all known bees mutations")
public List<Map<String, String>> listAllSpecies(IBeeHousing housing) {
    ISpeciesRoot beeRoot = AlleleManager.alleleRegistry.getSpeciesRoot("rootBees");
    if (beeRoot == null) return null;
    List<Map<String, String>> result = Lists.newArrayList();

    for (IMutation mutation : beeRoot.getMutations(false)) {
        IAllele[] template = mutation.getTemplate();
        if (template != null && template.length > 0) {
            IAllele allele = template[0];
            if (allele instanceof IAlleleSpecies) result.add(serializeSpecies((IAlleleSpecies)allele));
        }
    }

    return result;
}

If it's intended (as pointed in description 'get ... mutations'), why function is named listAllSpecies?