Interface TagHandler

All Superinterfaces:
TagReadable, TagWritable

public interface TagHandler extends TagReadable, TagWritable
Represents an element which can read and write tags.
  • Method Details

    • readableCopy

      @NotNull @NotNull TagReadable readableCopy()
      Creates a readable copy of this handler.

      Similar to asCompound() with the advantage that cached objects and adaptive optimizations may be reused.

      Returns:
      a copy of this handler
    • copy

      @NotNull @NotNull TagHandler copy()
      Creates a copy of this handler.

      Similar to fromCompound(CompoundBinaryTag) using asCompound() with the advantage that cached objects and adaptive optimizations may be reused.

      Returns:
      a copy of this handler
    • updateContent

      void updateContent(@NotNull @NotNull net.kyori.adventure.nbt.CompoundBinaryTag compound)
      Updates the content of this handler.

      Can be used as a clearing method with CompoundBinaryTag.empty().

      Parameters:
      compound - the new content of this handler
    • asCompound

      @NotNull @NotNull net.kyori.adventure.nbt.CompoundBinaryTag asCompound()
      Converts the content of this handler into a CompoundBinaryTag.
      Returns:
      a nbt compound representation of this handler
    • newHandler

      @NotNull static @NotNull TagHandler newHandler()
    • fromCompound

      @NotNull static @NotNull TagHandler fromCompound(@NotNull @NotNull net.kyori.adventure.nbt.CompoundBinaryTag compound)
      Copy the content of the given CompoundBinaryTag into a new TagHandler.
      Parameters:
      compound - the compound to read tags from
      Returns:
      a new tag handler with the content of the given compound