Package forestry.api.plugin
Interface ITreeSpeciesBuilder
- All Superinterfaces:
ISpeciesBuilder<ITreeSpeciesType,ITreeSpecies, ITreeSpeciesBuilder>
public interface ITreeSpeciesBuilder
extends ISpeciesBuilder<ITreeSpeciesType,ITreeSpecies,ITreeSpeciesBuilder>
-
Nested Class Summary
Nested classes/interfaces inherited from interface forestry.api.plugin.ISpeciesBuilder
ISpeciesBuilder.ISpeciesFactory<T extends ISpeciesType<S,?>, S extends ISpecies<?>, B extends ISpeciesBuilder<T, S, B>> -
Method Summary
Modifier and TypeMethodDescriptionaddVanillaSapling(net.minecraft.world.item.Item sapling) Adds a mundane item (no genetic component/NBT) that Forestry should consider as members of this species.addVanillaStates(Collection<net.minecraft.world.level.block.state.BlockState> states) Adds mundane states (no genetic BE) that Forestry should consider as members of this species.net.minecraft.world.item.ItemStackfloatList<net.minecraft.world.level.block.state.BlockState>List<net.minecraft.world.item.Item>setDecorativeLeaves(net.minecraft.world.item.ItemStack stack) Sets the decorative leaves block for this tree species.setEscritoireColor(net.minecraft.network.chat.TextColor color) setGenerator(ITreeGenerator generator) Sets the tree generator instance used to generate trees when growing from a sapling or being placed in the world.setRarity(float rarity) Sets the rarity for this tree to generate in a chunk during world generation.setTreeFeature(Function<ITreeGenData, net.minecraft.world.level.levelgen.feature.Feature<net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration>> factory) Shortcut to create a tree generator using the tree generator built into Forestry.setWoodType(IWoodType woodType) Methods inherited from interface forestry.api.plugin.ISpeciesBuilder
addMutations, buildGenome, buildMutations, createSpeciesFactory, getAuthority, getComplexity, getEscritoireColor, getGenus, getHumidity, getSpecies, getTemperature, hasGlint, isDominant, isSecret, setAuthority, setComplexity, setDominant, setEscritoireColor, setFactory, setGenome, setGlint, setHumidity, setSecret, setTemperature
-
Method Details
-
setTreeFeature
ITreeSpeciesBuilder setTreeFeature(Function<ITreeGenData, net.minecraft.world.level.levelgen.feature.Feature<net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration>> factory) Shortcut to create a tree generator using the tree generator built into Forestry. -
setGenerator
Sets the tree generator instance used to generate trees when growing from a sapling or being placed in the world.- Parameters:
generator- The tree generator instance. UsesetTreeFeature(java.util.function.Function<forestry.api.arboriculture.ITreeGenData, net.minecraft.world.level.levelgen.feature.Feature<net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration>>)to use Forestry's default generator.
-
addVanillaStates
ITreeSpeciesBuilder addVanillaStates(Collection<net.minecraft.world.level.block.state.BlockState> states) Adds mundane states (no genetic BE) that Forestry should consider as members of this species. When Forestry encounters a mundane leaf/sapling block, a list of states are queried to see what individual the block should contain. The genome of this individual always has the DEFAULT genome.An example where this is used is to treat vanilla Oak leaves and saplings as members of the Apple Oak species. There is another important case: treating "decorative" and "default" leaves as members of a species. Forestry adds default and decorative forms of all leaf blocks to avoid generating trees with tons of BEs. These forms lack BEs, so these block states are passed to this method as well.
- Parameters:
states- A list of mundane (no BE) states to add as members of this species.
-
addVanillaSapling
Adds a mundane item (no genetic component/NBT) that Forestry should consider as members of this species. Used by the portable analyzer to convert vanilla saplings into their Forestry equivalents when analyzing.- Parameters:
sapling- The item that should count as this species.
-
setDecorativeLeaves
Sets the decorative leaves block for this tree species. Used by shears and pick-block. The decorative form has no genome or block entity which is better for performance, but has no functionality. Calling this method is not required but highly recommended.- Parameters:
stack- The item form of the decorative leaves for this species.- Returns:
- The decorative form of this species's leaves block.
-
setWoodType
-
setRarity
Sets the rarity for this tree to generate in a chunk during world generation. By default, the rarity is 0, which means the tree never spawns naturally.- Parameters:
rarity- A float between 0 and 1 that determines how often this tree spawns naturally.
-
setEscritoireColor
Overrides the escritoire color set inIArboricultureRegistration.registerSpecies(net.minecraft.resources.ResourceLocation, java.lang.String, java.lang.String, boolean, net.minecraft.network.chat.TextColor, forestry.api.arboriculture.IWoodType).- Specified by:
setEscritoireColorin interfaceISpeciesBuilder<ITreeSpeciesType,ITreeSpecies, ITreeSpeciesBuilder> - Parameters:
color- The color.- See Also:
-
getGenerator
-
getVanillaLeafStates
List<net.minecraft.world.level.block.state.BlockState> getVanillaLeafStates() -
getVanillaSaplingItems
List<net.minecraft.world.item.Item> getVanillaSaplingItems() -
getDecorativeLeaves
net.minecraft.world.item.ItemStack getDecorativeLeaves() -
getRarity
float getRarity()
-