Class FabricTagProvider.FabricTagBuilder<T>
java.lang.Object
net.minecraft.data.server.AbstractTagProvider.ObjectBuilder<T>
net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider.FabricTagBuilder<T>
- Enclosing class:
FabricTagProvider<T>
public final class FabricTagProvider.FabricTagBuilder<T>
extends AbstractTagProvider.ObjectBuilder<T>
An extension to
AbstractTagProvider.ObjectBuilder that provides additional functionality.-
Method Summary
Modifier and TypeMethodDescriptionadd(Identifier id) Add a single element to the tag.add(Identifier... ids) Add multiple elements to this tag.add(RegistryKey<? extends T> registryKey) Add a single element to the tag.final FabricTagProvider<T>.FabricTagBuilder<T>add(RegistryKey<T>... registryKeys) Add multiple elements to this tag.Add a single element to the tag.final FabricTagProvider<T>.FabricTagBuilder<T>Add multiple elements to this tag.Add an optionalIdentifierto the tag.addOptional(RegistryKey<? extends T> registryKey) Add an optionalRegistryKeyto the tag.addOptionalTag(TagKey<T> tag) Add another optional tag to this tag.Add another optional tag to this tag.Add another tag to this tag.forceAddTag(TagKey<T> tag) Add another tag to this tag, ignoring any warning.setReplace(boolean replace) Set the value of the `replace` flag in a Tag.
-
Method Details
-
setReplace
Set the value of the `replace` flag in a Tag.When set to true the tag will replace any existing tag entries.
- Returns:
- the
FabricTagProvider.FabricTagBuilderinstance
-
add
Add a single element to the tag.- Overrides:
addin classAbstractTagProvider.ObjectBuilder<T>- Returns:
- the
FabricTagProvider.FabricTagBuilderinstance - Throws:
UnsupportedOperationException- if the provider is an instance ofFabricTagProvider.DynamicRegistryTagProvider- See Also:
-
add
Add a single element to the tag.- Returns:
- the
FabricTagProvider.FabricTagBuilderinstance
-
add
Add a single element to the tag.- Returns:
- the
FabricTagProvider.FabricTagBuilderinstance
-
addOptional
Add an optionalIdentifierto the tag.- Overrides:
addOptionalin classAbstractTagProvider.ObjectBuilder<T>- Returns:
- the
FabricTagProvider.FabricTagBuilderinstance
-
addOptional
Add an optionalRegistryKeyto the tag.- Returns:
- the
FabricTagProvider.FabricTagBuilderinstance
-
addTag
Add another tag to this tag.Note: any vanilla tags can be added to the builder, but other tags can only be added if it has a builder registered in the same provider.
Use
forceAddTag(TagKey)to force add any tag.- Overrides:
addTagin classAbstractTagProvider.ObjectBuilder<T>- Returns:
- the
FabricTagProvider.FabricTagBuilderinstance - See Also:
-
addOptionalTag
Add another optional tag to this tag.- Overrides:
addOptionalTagin classAbstractTagProvider.ObjectBuilder<T>- Returns:
- the
FabricTagProvider.FabricTagBuilderinstance
-
addOptionalTag
Add another optional tag to this tag.- Returns:
- the
FabricTagProvider.FabricTagBuilderinstance
-
forceAddTag
Add another tag to this tag, ignoring any warning.Note: only use this method if you sure that the tag will be always available at runtime. If not, use
addOptionalTag(Identifier)instead.- Returns:
- the
FabricTagProvider.FabricTagBuilderinstance
-
add
Add multiple elements to this tag.- Overrides:
addin classAbstractTagProvider.ObjectBuilder<T>- Returns:
- the
FabricTagProvider.FabricTagBuilderinstance - Throws:
UnsupportedOperationException- if the provider is an instance ofFabricTagProvider.DynamicRegistryTagProvider
-
add
Add multiple elements to this tag.- Returns:
- the
FabricTagProvider.FabricTagBuilderinstance
-
add
@SafeVarargs public final FabricTagProvider<T>.FabricTagBuilder<T> add(RegistryKey<T>... registryKeys) Add multiple elements to this tag.- Overrides:
addin classAbstractTagProvider.ObjectBuilder<T>- Returns:
- the
FabricTagProvider.FabricTagBuilderinstance
-