Class UnknownTagManager

java.lang.Object
com.blamejared.crafttweaker.api.tag.manager.type.UnknownTagManager
All Implemented Interfaces:
CommandStringDisplayable, ITagManager<UnknownTag>, Iterable<UnknownTag>

@ZenRegister(loaders={"crafttweaker","tags"}) public class UnknownTagManager extends Object implements ITagManager<UnknownTag>
  • Constructor Summary

    Constructors
    Constructor
    Description
    UnknownTagManager(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>> resourceKey)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    addId(UnknownTag to, net.minecraft.resources.ResourceLocation... values)
    Adds the elements that correspond to the given ResourceLocation to the given tag.
    <U> void
    addTag(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.
    void
    bind(net.minecraft.tags.TagManager.LoadResult<?> result)
    Binds this manager to the given load result.
    void
    Clears all values of the given tag.
    net.minecraft.tags.Tag<net.minecraft.core.Holder<?>>
    Gets the internal Tag<Holder> of the given tag.
    Map<net.minecraft.resources.ResourceLocation,net.minecraft.tags.Tag<net.minecraft.core.Holder<?>>>
    Gets the internal tags of this manager.
    void
    Recalculates the cached tag map.
    final void
    removeId(UnknownTag from, net.minecraft.resources.ResourceLocation... values)
    Removes the elements that correspond to the given ResourceLocation from the given tag.
    net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>>
    Gets the resource key of the registry that this manager deals with.
    tag(String id)
    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>
    Gets the keys of the tags that this manager knows about.
    Map<net.minecraft.resources.ResourceLocation,UnknownTag>
    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, wait

    Methods inherited from interface com.blamejared.crafttweaker.api.tag.manager.ITagManager

    elementClass, exists, exists, exists, getCommandString, getTagsFor, idElements, iterator, tag, tagFolder, tags

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Constructor Details

    • UnknownTagManager

      public UnknownTagManager(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>> resourceKey)
  • Method Details

    • resourceKey

      public net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>> resourceKey()
      Description copied from interface: ITagManager
      Gets the resource key of the registry that this manager deals with.
      Specified by:
      resourceKey in interface ITagManager<UnknownTag>
      Returns:
      The resource key of the registry that this manager deals with.
    • addId

      public final void addId(UnknownTag to, net.minecraft.resources.ResourceLocation... values)
      Description copied from interface: ITagManager
      Adds the elements that correspond to the given ResourceLocation to the given tag.
      Specified by:
      addId in interface ITagManager<UnknownTag>
      Parameters:
      to - The tag to add to.
      values - The registry key of the elements to add.
    • removeId

      public final void removeId(UnknownTag from, net.minecraft.resources.ResourceLocation... values)
      Description copied from interface: ITagManager
      Removes the elements that correspond to the given ResourceLocation from the given tag.
      Specified by:
      removeId in interface ITagManager<UnknownTag>
      Parameters:
      from - The tag to remove from.
      values - The registry key of the elements to remove.
    • clear

      public void clear(UnknownTag from)
      Description copied from interface: ITagManager
      Clears all values of the given tag.
      Specified by:
      clear in interface ITagManager<UnknownTag>
      Parameters:
      from - The tag to clear.
    • tag

      public UnknownTag tag(String id)
      Description copied from interface: ITagManager
      Gets a tag with the given id.
      Specified by:
      tag in interface ITagManager<UnknownTag>
      Parameters:
      id - The id of the tag.
      Returns:
      A tag with the given id.
    • tag

      public UnknownTag tag(net.minecraft.resources.ResourceLocation id)
      Description copied from interface: ITagManager
      Gets a tag with the given id.
      Specified by:
      tag in interface ITagManager<UnknownTag>
      Parameters:
      id - The id of the tag.
      Returns:
      A tag with the given id.
    • recalculate

      public void recalculate()
      Description copied from interface: ITagManager
      Recalculates the cached tag map.
      Specified by:
      recalculate in interface ITagManager<UnknownTag>
    • tagMap

      public Map<net.minecraft.resources.ResourceLocation,UnknownTag> tagMap()
      Description copied from interface: ITagManager
      Gets a map of id to tag that this manager knows about.
      Specified by:
      tagMap in interface ITagManager<UnknownTag>
      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: ITagManager
      Gets the internal tags of this manager.
      Specified by:
      internalTags in interface ITagManager<UnknownTag>
      Returns:
      a map of id to tag.
    • getInternalRaw

      @Nullable public net.minecraft.tags.Tag<net.minecraft.core.Holder<?>> getInternalRaw(UnknownTag tag)
      Description copied from interface: ITagManager
      Gets the internal Tag<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:
      getInternalRaw in interface ITagManager<UnknownTag>
      Parameters:
      tag - The tag to get the internal value of.
      Returns:
      The internal Tag<Holder> of the given tag.
    • tagKeys

      public List<net.minecraft.resources.ResourceLocation> tagKeys()
      Description copied from interface: ITagManager
      Gets the keys of the tags that this manager knows about.
      Specified by:
      tagKeys in interface ITagManager<UnknownTag>
      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: ITagManager
      Adds a tag to this manager with the given id.
      Specified by:
      addTag in interface ITagManager<UnknownTag>
      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: ITagManager
      Binds this manager to the given load result.

      This is usually storing the given TagManager.LoadResult into a MutableLoadResult which allows for easy mutation.

      Specified by:
      bind in interface ITagManager<UnknownTag>
      Parameters:
      result - The result to bind to.