Skip to content

Data Generators

Harley O'Connor edited this page Jun 19, 2021 · 1 revision

As of DT Beta 17, we now provide a few data generators to automate generation of things like tags for add-ons based on the families and species they register.

Item Tag Provider

The DTItemTagsProvider [View Source] generates seed tags for any registered seeds under any Species with the provided Mod ID. It can be set up, along with the block tags provider, using DynamicTrees#gatherTagGenerators(String, GatherDataEvent). See details here.

Block Tag Provider

The DTBlockTagsProvider [View Source] generates leaves, branch, stripped branch, and sapling block tags for any of the registered blocks under any Leaves Properties, Families, or Species with the provided Mod ID. It can be set up, along with the block tags provider, using DynamicTrees#gatherTagGenerators(String, GatherDataEvent). See details here.

Automatic Tag Setup

The method DynamicTrees#gatherTagGenerators(String, GatherDataEvent) can be used to instantiate an item tag provider and block tag provider with the given Mod ID. It also requires a GatherDataEvent, so add-ons will need a listener for this event to call this method from.

Other Generators

In the future we also plan on implementing block state and model providers to automate the monotonous process of adding these. When these are added, this page will be updated with the details on how to use them.