Class KnownTagManager<T>
java.lang.Object
com.blamejared.crafttweaker.api.tag.manager.type.KnownTagManager<T>
- All Implemented Interfaces:
CommandStringDisplayable,ITagManager<KnownTag<T>>,Iterable<KnownTag<T>>
- Direct Known Subclasses:
EntityTypeTagManager
-
Constructor Summary
ConstructorsConstructorDescriptionKnownTagManager(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> resourceKey, Class<T> elementClass) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddElements(KnownTag<T> to, T... values) voidAdds the elements that correspond to the givenResourceLocationto the given tag.<U> voidaddTag(net.minecraft.resources.ResourceLocation id, net.minecraft.tags.Tag<net.minecraft.core.Holder<U>> tag) Adds a tag to this manager with the given id.voidbind(net.minecraft.tags.TagManager.LoadResult<?> result) Binds this manager to the given load result.voidClears all values of the given tag.Gets the element type that this tag manager handles.Gets the elements of the given tag.net.minecraft.tags.Tag<net.minecraft.core.Holder<T>>getInternal(KnownTag<T> tag) net.minecraft.tags.Tag<net.minecraft.core.Holder<?>>getInternalRaw(KnownTag<T> tag) Gets the internalTag<Holder> of the given tag.getTagsFor(T element) Map<net.minecraft.resources.ResourceLocation,net.minecraft.tags.Tag<net.minecraft.core.Holder<?>>> Gets the internal tags of this manager.voidRecalculates the cached tag map.final voidremoveElements(KnownTag<T> from, T... values) final voidRemoves the elements that correspond to the givenResourceLocationfrom the given tag.net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>>Gets the resource key of the registry that this manager deals with.Gets a tag with the given id.tag(net.minecraft.resources.ResourceLocation id) Gets a tag with the given id.List<net.minecraft.resources.ResourceLocation>tagKeys()Gets the keys of the tags that this manager knows about.tagMap()Gets a map of id to tag that this manager knows about.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.blamejared.crafttweaker.api.tag.manager.ITagManager
exists, exists, exists, getCommandString, getTagsFor, idElements, iterator, tag, tagFolder, tagsMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
KnownTagManager
-
-
Method Details
-
elementClass
Description copied from interface:ITagManagerGets the element type that this tag manager handles.This is only used to fill in type parameters, if your custom ITagManager does not have a type paremeter, you can return an empty optional.
- Specified by:
elementClassin interfaceITagManager<T>- Returns:
- An optional class of the type of elements that this manager deals with.
-
resourceKey
Description copied from interface:ITagManagerGets the resource key of the registry that this manager deals with.- Specified by:
resourceKeyin interfaceITagManager<T>- Returns:
- The resource key of the registry that this manager deals with.
-
addElements
-
addId
Description copied from interface:ITagManagerAdds the elements that correspond to the givenResourceLocationto the given tag.- Specified by:
addIdin interfaceITagManager<T>- Parameters:
to- The tag to add to.values- The registry key of the elements to add.
-
removeId
Description copied from interface:ITagManagerRemoves the elements that correspond to the givenResourceLocationfrom the given tag.- Specified by:
removeIdin interfaceITagManager<T>- Parameters:
from- The tag to remove from.values- The registry key of the elements to remove.
-
clear
Description copied from interface:ITagManagerClears all values of the given tag.- Specified by:
clearin interfaceITagManager<T>- Parameters:
from- The tag to clear.
-
elements
Gets the elements of the given tag.- Parameters:
of- The tag to get the elements of.- Returns:
- The list of elements in the tag.
- DocParam:
- of <tag:items:minecraft:dirt>
-
removeElements
-
tag
Description copied from interface:ITagManagerGets a tag with the given id.- Specified by:
tagin interfaceITagManager<T>- Parameters:
id- The id of the tag.- Returns:
- A tag with the given id.
-
tag
Description copied from interface:ITagManagerGets a tag with the given id.- Specified by:
tagin interfaceITagManager<T>- Parameters:
id- The id of the tag.- Returns:
- A tag with the given id.
-
recalculate
public void recalculate()Description copied from interface:ITagManagerRecalculates the cached tag map.- Specified by:
recalculatein interfaceITagManager<T>
-
tagMap
Description copied from interface:ITagManagerGets a map of id to tag that this manager knows about.- Specified by:
tagMapin interfaceITagManager<T>- Returns:
- a map of id to tag.
-
internalTags
public Map<net.minecraft.resources.ResourceLocation,net.minecraft.tags.Tag<net.minecraft.core.Holder<?>>> internalTags()Description copied from interface:ITagManagerGets the internal tags of this manager.- Specified by:
internalTagsin interfaceITagManager<T>- Returns:
- a map of id to tag.
-
getInternal
-
getInternalRaw
@Nullable public net.minecraft.tags.Tag<net.minecraft.core.Holder<?>> getInternalRaw(KnownTag<T> tag) Description copied from interface:ITagManagerGets the internalTag<Holder> of the given tag.This method should only be used when you do not have access to the more specific version of this method in
KnownTagManager- Specified by:
getInternalRawin interfaceITagManager<T>- Parameters:
tag- The tag to get the internal value of.- Returns:
- The internal
Tag<Holder> of the given tag.
-
tagKeys
Description copied from interface:ITagManagerGets the keys of the tags that this manager knows about.- Specified by:
tagKeysin interfaceITagManager<T>- Returns:
- A List of keys of the tags that this manager knows about.
-
addTag
public <U> void addTag(net.minecraft.resources.ResourceLocation id, net.minecraft.tags.Tag<net.minecraft.core.Holder<U>> tag) Description copied from interface:ITagManagerAdds a tag to this manager with the given id.- Specified by:
addTagin interfaceITagManager<T>- Parameters:
id- The id of the tag to add.tag- The tag to add
-
bind
public void bind(net.minecraft.tags.TagManager.LoadResult<?> result) Description copied from interface:ITagManagerBinds this manager to the given load result.This is usually storing the given
TagManager.LoadResultinto aMutableLoadResultwhich allows for easy mutation.- Specified by:
bindin interfaceITagManager<T>- Parameters:
result- The result to bind to.
-
getTagsFor
-