Class MixedListTag

java.lang.Object
com.viaversion.nbt.tag.ListTag<Tag>
com.viaversion.nbt.tag.MixedListTag
All Implemented Interfaces:
Tag, Iterable<Tag>

public final class MixedListTag extends ListTag<Tag>
Vanilla abomination that allows for mixed tag lists, serialized to a list of wrapping compound tags...

getElementType() will always return null.

  • Constructor Details

    • MixedListTag

      public MixedListTag()
    • MixedListTag

      public MixedListTag(List<Tag> value)
  • Method Details

    • setValue

      public void setValue(List<Tag> value)
      Description copied from class: ListTag
      Sets the value of this tag. The list tag's type will be set to that of the first tag being added, or null if the given list is empty.
      Overrides:
      setValue in class ListTag<Tag>
      Parameters:
      value - New value of this tag.
    • getElementType

      @Nullable public @Nullable Class<? extends Tag> getElementType()
      Description copied from class: ListTag
      Gets the element type of the ListTag.
      Overrides:
      getElementType in class ListTag<Tag>
      Returns:
      The ListTag's element type, or null if the list does not yet have a defined type.
    • write

      public void write(DataOutput out) throws IOException
      Description copied from interface: Tag
      Writes this tag to an output stream.
      Specified by:
      write in interface Tag
      Overrides:
      write in class ListTag<Tag>
      Parameters:
      out - data output to write to
      Throws:
      IOException - if an I/O error occurs
    • copy

      public MixedListTag copy()
      Description copied from interface: Tag
      Returns a copy of this tag.
      Specified by:
      copy in interface Tag
      Overrides:
      copy in class ListTag<Tag>
      Returns:
      a copy of this tag