From 68fc705cd325ecf8f8928e2e7122591b2a73a478 Mon Sep 17 00:00:00 2001 From: TheMode Date: Mon, 2 May 2022 13:34:05 +0200 Subject: [PATCH] More doc to TagHandler Signed-off-by: TheMode --- .../net/minestom/server/tag/TagHandler.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/main/java/net/minestom/server/tag/TagHandler.java b/src/main/java/net/minestom/server/tag/TagHandler.java index 7218e267e..436026da8 100644 --- a/src/main/java/net/minestom/server/tag/TagHandler.java +++ b/src/main/java/net/minestom/server/tag/TagHandler.java @@ -10,12 +10,40 @@ import org.jglrxavpok.hephaistos.nbt.NBTCompoundLike; */ public interface TagHandler extends TagReadable, TagWritable { + /** + * Creates a readable copy of this handler. + *

+ * Similar to {@link #asCompound()} with the advantage that cached objects + * and adaptive optimizations may be reused. + * + * @return a copy of this handler + */ @NotNull TagReadable readableCopy(); + /** + * Creates a copy of this handler. + *

+ * Similar to {@link #fromCompound(NBTCompoundLike)} using {@link #asCompound()} + * with the advantage that cached objects and adaptive optimizations may be reused. + * + * @return a copy of this handler + */ @NotNull TagHandler copy(); + /** + * Updates the content of this handler. + *

+ * Can be used as a clearing method with {@link NBTCompound#EMPTY}. + * + * @param compound the new content of this handler + */ void updateContent(@NotNull NBTCompoundLike compound); + /** + * Converts the content of this handler into a {@link NBTCompound}. + * + * @return a nbt compound representation of this handler + */ @NotNull NBTCompound asCompound(); @ApiStatus.Experimental