OpenMods / OpenPeripheral

https://openmods.info
MIT License
67 stars 25 forks source link

BeeInfo table always shows false for tolerantFlyer #103

Closed CaseyRobinson closed 10 years ago

CaseyRobinson commented 10 years ago

With Forestry 2.3.1.0 and OpenPeripheral 0.2.1-snapshot99, I've noticed that the beeInfo tables (active and inactive) always show tolerantFlyer as being false. I've done some code diving and found it a little strange that the nocturnal and cave values are added like this:

active.put("caveDwelling", ((IAlleleBoolean)genome.getActiveAllele(EnumBeeChromosome.CAVE_DWELLING.ordinal())).getValue());
inactive.put("caveDwelling", ((IAlleleBoolean)genome.getInactiveAllele(EnumBeeChromosome.CAVE_DWELLING.ordinal())).getValue());

active.put("nocturnal", ((IAlleleBoolean)genome.getActiveAllele(EnumBeeChromosome.NOCTURNAL.ordinal())).getValue());
inactive.put("nocturnal", ((IAlleleBoolean)genome.getInactiveAllele(EnumBeeChromosome.NOCTURNAL.ordinal())).getValue());

And tolerantFlyer is done like this, with isDominant instead of getValue:

active.put("tolerantFlyer", genome.getActiveAllele(EnumBeeChromosome.TOLERANT_FLYER.ordinal()).isDominant());
inactive.put("tolerantFlyer", genome.getInactiveAllele(EnumBeeChromosome.TOLERANT_FLYER.ordinal()).isDominant());

I know this isn't a recent version of OpenPeripheral, but it also looks like this code hasn't changed.