Skip to content

Commit

Permalink
Improve logic
Browse files Browse the repository at this point in the history
  • Loading branch information
temp1011 committed Feb 28, 2018
1 parent ed2f06c commit 1b262d6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
7 changes: 0 additions & 7 deletions src/main/java/forestry/apiculture/genetics/Bee.java
Expand Up @@ -716,13 +716,6 @@ public boolean pollinateRandom(IBeeHousing housing, IIndividual pollen) {
continue;
}
if (!checkPollinatable.canMateWith(pollen)) {
if (checkPollinatable.canMateWith(checkPollinatable.getPollen()) && ModuleApiculture.doSelfPollination) {
IPollinatable realPollinatable = GeneticsUtil.getOrCreatePollinatable(housing.getOwner(), world, posBlock, Config.pollinateVanillaTrees);

if (realPollinatable != null) {
realPollinatable.mateWith(realPollinatable.getPollen());
}
}
continue;
}

Expand Down
Expand Up @@ -13,6 +13,8 @@
import forestry.api.arboriculture.ITree;
import forestry.api.genetics.ICheckPollinatable;
import forestry.api.genetics.IIndividual;
import forestry.apiculture.ModuleApiculture;

import net.minecraftforge.common.EnumPlantType;

public class CheckPollinatableTree implements ICheckPollinatable {
Expand All @@ -36,7 +38,7 @@ public ITree getPollen() {
public boolean canMateWith(IIndividual pollen) {
return pollen instanceof ITree &&
tree.getMate() == null &&
!tree.isGeneticEqual(pollen);
(ModuleApiculture.doSelfPollination || !tree.isGeneticEqual(pollen));
}

@Override
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/forestry/arboriculture/tiles/TileLeaves.java
Expand Up @@ -53,6 +53,7 @@
import forestry.api.lepidopterology.IButterfly;
import forestry.api.lepidopterology.IButterflyGenome;
import forestry.api.lepidopterology.IButterflyNursery;
import forestry.apiculture.ModuleApiculture;
import forestry.arboriculture.ModuleArboriculture;
import forestry.arboriculture.genetics.TreeDefinition;
import forestry.arboriculture.genetics.alleles.AlleleFruits;
Expand Down Expand Up @@ -309,7 +310,7 @@ public boolean canMateWith(IIndividual individual) {
ITree tree = getTree();
return tree != null &&
tree.getMate() == null &&
!tree.isGeneticEqual(individual);
(ModuleApiculture.doSelfPollination ||!tree.isGeneticEqual(individual));
}
return false;
}
Expand Down

0 comments on commit 1b262d6

Please sign in to comment.