Package forestry.api.plugin
Interface ISpeciesBuilder<T extends ISpeciesType<S,?>,S extends ISpecies<?>,B extends ISpeciesBuilder<T,S,B>>
- All Known Subinterfaces:
IBeeSpeciesBuilder,IButterflySpeciesBuilder,ITreeSpeciesBuilder
public interface ISpeciesBuilder<T extends ISpeciesType<S,?>,S extends ISpecies<?>,B extends ISpeciesBuilder<T,S,B>>
Customize properties shared by all species types. Implement this class for your species type registration.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceISpeciesBuilder.ISpeciesFactory<T extends ISpeciesType<S,?>, S extends ISpecies<?>, B extends ISpeciesBuilder<T, S, B>> -
Method Summary
Modifier and TypeMethodDescriptionaddMutations(Consumer<IMutationsRegistration> mutations) Define mutations that mutate into this species.buildGenome(IGenomeBuilder builder) Used to create the default genome object for this species during registration.buildMutations(ISpeciesType<S, ?> speciesType, com.google.common.collect.ImmutableMap<net.minecraft.resources.ResourceLocation, S> speciesLookup) intintgetGenus()booleanhasGlint()booleanbooleanisSecret()setAuthority(String authority) Sets the name of this species's discoverer.setComplexity(int complexity) Overrides the default complexity of this species, a number between 1 and 10 used by the Escritoire to determine how many cells the memory game has when analyzing a specimen of this species.setDominant(boolean dominant) Overrides whether the allele of this species is dominant.default BsetEscritoireColor(Color color) Deprecated, for removal: This API element is subject to removal in a future version.Use the variant that accepts a TextColorsetEscritoireColor(net.minecraft.network.chat.TextColor color) Sets the escritoire color of this species.setFactory(ISpeciesBuilder.ISpeciesFactory<T, S, B> factory) Use a custom class for this species.setGenome(Consumer<IGenomeBuilder> genome) Customize the default alleles for each chromosome in the karyotype.setGlint(boolean glint) Specify whether item forms of this species will have an enchantment glint.setHumidity(HumidityType humidity) Sets the ideal humidity preference of this species.setSecret(boolean secret) Specify whether this bee species is a "secret" species whose mutation cannot be discovered in the Escritoire.setTemperature(TemperatureType temperature) Sets the ideal temperature preference of this species.
-
Method Details
-
setDominant
Overrides whether the allele of this species is dominant. Usually set first by a "registerSpecies" method parameter. -
setGenome
Customize the default alleles for each chromosome in the karyotype. Called afterITaxonBuilder.setDefaultChromosome(forestry.api.genetics.alleles.IChromosome<A>, A)which in turn is called afterISpeciesTypeBuilder.setKaryotype(java.util.function.Consumer<forestry.api.plugin.IKaryotypeBuilder>). -
addMutations
Define mutations that mutate into this species. -
setGlint
Specify whether item forms of this species will have an enchantment glint. Usually for rare/milestone species like Steadfast or Industrious. For trees and butterflies, only applies to their item forms, not their block/entity forms. -
setTemperature
Sets the ideal temperature preference of this species. All species types in base Forestry use climate information. If a species type from an addon doesn't use this information, this method does nothing. -
setHumidity
Sets the ideal humidity preference of this species. All species types in base Forestry use climate information. If a species type from an addon doesn't use this information, this method does nothing. -
setComplexity
Overrides the default complexity of this species, a number between 1 and 10 used by the Escritoire to determine how many cells the memory game has when analyzing a specimen of this species. By default, complexity is determined by the number of breeding steps required to breed this species. -
setEscritoireColor
Sets the escritoire color of this species. Used for Escritoire game cells. If this method is never called, then the default escritoire color is-1. Usually, this method is optional and the color of the game cell is fetched from some other property. For example, bees use their outline color, and butterflies use their serum color. However, this property must be set manually in the case of tree species.- Parameters:
color- The color of the Escritoire memory cell when displaying this species.
-
setEscritoireColor
Deprecated, for removal: This API element is subject to removal in a future version.Use the variant that accepts a TextColor -
setSecret
Specify whether this bee species is a "secret" species whose mutation cannot be discovered in the Escritoire.Example species include:
- Holiday species (Leporine, Merry, Tricky, Tipsy)
- Iridium-producing species (Vindictive, Vengeful, Avenging)
- Easter eggs like the secret Benson species from Career Bees
-
setAuthority
Sets the name of this species's discoverer. Most of the time, it is either Sengir, Binnie, or MysteriousAges.- Parameters:
authority- The name of the person who discovered this bee species.
-
setFactory
Use a custom class for this species. Default is usually something likeBeeSpecies::new. -
getGenus
String getGenus()- Returns:
- The scientific name of the genus this species belongs to. Usually set when the builder is created.
-
getSpecies
String getSpecies()- Returns:
- The scientific name of the species without the genus. Usually set when the builder is created.
-
isDominant
boolean isDominant()- Returns:
- Whether alleles of this species are dominant. Set in
setDominant(boolean).
-
buildGenome
Used to create the default genome object for this species during registration.- Parameters:
builder- A genome builder with alleles set first by the karyotype, then by the parent taxa of this species.- Returns:
- A completed default genome for this species, with all alleles that have been set in
setGenome(java.util.function.Consumer<forestry.api.plugin.IGenomeBuilder>).
-
hasGlint
boolean hasGlint()- Returns:
- Whether the item form of this species has an enchantment glint. Set in
setGlint(boolean).
-
getTemperature
TemperatureType getTemperature() -
getHumidity
HumidityType getHumidity() -
getComplexity
int getComplexity() -
getEscritoireColor
int getEscritoireColor()- Returns:
- The escritoire cell color of this species, or
-1ifsetEscritoireColor(net.minecraft.network.chat.TextColor)was not called.
-
isSecret
boolean isSecret()- Returns:
- Whether this species should be hidden in creative menus or JEI. Set in
setSecret(boolean).
-
getAuthority
String getAuthority()- Returns:
- The name of who created this species. The default is "SirSengir". Set in
setAuthority(java.lang.String).
-
createSpeciesFactory
ISpeciesBuilder.ISpeciesFactory<T,S, createSpeciesFactory()B> -
buildMutations
-