Beispiel #1
0
 public void register() {
   System.arraycopy(this.getSpeciesTemplate(), 0, template, 0, template.length);
   AlleleManager.alleleRegistry.registerAllele(this);
   beeRoot.registerTemplate(template);
   AlleleManager.alleleRegistry.getClassification("family.apidae").addMemberGroup(branch);
   isRegistered = true;
 }
Beispiel #2
0
 protected final IAllele[] getSpeciesTemplate() {
   IAllele[] alleles = beeRoot.getDefaultTemplate();
   alleles[EnumBeeChromosome.SPECIES.ordinal()] = this;
   alleles[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = this.getFlowerAllele();
   alleles[EnumBeeChromosome.SPEED.ordinal()] = this.getProductionSpeed().getAllele();
   alleles[EnumBeeChromosome.LIFESPAN.ordinal()] = this.getLifespan().getAllele();
   alleles[EnumBeeChromosome.TERRITORY.ordinal()] = this.getTerritorySize().getAllele();
   alleles[EnumBeeChromosome.FLOWERING.ordinal()] = this.getFloweringRate().getAllele();
   alleles[EnumBeeChromosome.FERTILITY.ordinal()] = this.getFertility().getAllele();
   alleles[EnumBeeChromosome.EFFECT.ordinal()] = this.getEffectAllele();
   alleles[EnumBeeChromosome.NOCTURNAL.ordinal()] = this.getGeneForBoolean(this.isNocturnal());
   alleles[EnumBeeChromosome.CAVE_DWELLING.ordinal()] =
       this.getGeneForBoolean(this.isCaveDwelling());
   alleles[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] =
       this.getToleranceGene(this.getTemperatureToleranceDir(), this.getTemperatureTolerance());
   alleles[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] =
       this.getToleranceGene(this.getHumidityToleranceDir(), this.getHumidityTolerance());
   return alleles;
 }
Beispiel #3
0
 private final void addBreeding(IAlleleBeeSpecies p1, IAlleleBeeSpecies p2, int chance) {
   if (!isRegistered)
     throw new MisuseException("You must register a bee before adding breeding pairs!");
   if (p1 == null || p2 == null) throw new MisuseException("You cannot breed a bee from null!");
   beeRoot.registerMutation(new BeeBreeding(p1, p2, chance, this));
 }
Beispiel #4
0
 public final ItemStack getBeeItem(World world, EnumBeeType type) {
   return beeRoot.getMemberStack(
       beeRoot.getBee(world, beeRoot.templateAsGenome(template)), type.ordinal());
 }