use of forestry.api.apiculture.IBeeGenome in project Binnie by ForestryMC.
the class ControlBiomes method setSpecies.
public void setSpecies(IAlleleBeeSpecies species) {
tolerated.clear();
IBeeGenome genome = BeeManager.beeRoot.templateAsGenome(BeeManager.beeRoot.getTemplate(species));
IBee bee = BeeManager.beeRoot.getBee(genome);
}
use of forestry.api.apiculture.IBeeGenome in project Binnie by ForestryMC.
the class ControlProductsBox method setSpecies.
public void setSpecies(IAlleleBeeSpecies species) {
if (species == this.species || (this.species = species) == null) {
return;
}
IAllele[] template = BeeManager.beeRoot.getTemplate(species.getUID());
if (template == null) {
return;
}
IBeeGenome genome = BeeManager.beeRoot.templateAsGenome(template);
float speed = genome.getSpeed();
float modeSpeed = BeeManager.beeRoot.getBeekeepingMode(BinnieCore.getBinnieProxy().getWorld()).getBeeModifier().getProductionModifier(genome, 1.0f);
List<Product> strings = new ArrayList<>();
if (type == Type.PRODUCTS) {
for (Map.Entry<ItemStack, Float> entry : species.getProductChances().entrySet()) {
strings.add(new Product(entry.getKey(), speed * modeSpeed * entry.getValue()));
}
} else {
for (Map.Entry<ItemStack, Float> entry : species.getSpecialtyChances().entrySet()) {
strings.add(new Product(entry.getKey(), speed * modeSpeed * entry.getValue()));
}
}
setOptions(strings);
}
use of forestry.api.apiculture.IBeeGenome in project Binnie by ForestryMC.
the class ControlClimateBar method setSpecies.
public void setSpecies(IAlleleBeeSpecies species) {
tolerated.clear();
int main;
EnumTolerance tolerance;
IAllele[] template = BeeManager.beeRoot.getTemplate(species);
IBeeGenome genome = BeeManager.beeRoot.templateAsGenome(template);
if (!isHumidity) {
main = species.getTemperature().ordinal() - 1;
tolerance = genome.getToleranceTemp();
} else {
main = species.getHumidity().ordinal();
tolerance = genome.getToleranceHumid();
}
tolerated.add(main);
switch(tolerance) {
case BOTH_5:
case UP_5:
{
tolerated.add(main + 5);
}
case BOTH_4:
case UP_4:
{
tolerated.add(main + 4);
}
case BOTH_3:
case UP_3:
{
tolerated.add(main + 3);
}
case BOTH_2:
case UP_2:
{
tolerated.add(main + 2);
}
case BOTH_1:
case UP_1:
{
tolerated.add(main + 1);
break;
}
}
switch(tolerance) {
case BOTH_5:
case DOWN_5:
{
tolerated.add(main - 5);
}
case BOTH_4:
case DOWN_4:
{
tolerated.add(main - 4);
}
case BOTH_3:
case DOWN_3:
{
tolerated.add(main - 3);
}
case BOTH_2:
case DOWN_2:
{
tolerated.add(main - 2);
}
case BOTH_1:
case DOWN_1:
{
tolerated.add(main - 1);
break;
}
}
}
Aggregations