Package net.kyori.adventure.nbt
Interface CompoundTagSetter<R>
- Type Parameters:
R
- the return type
- All Known Subinterfaces:
CompoundBinaryTag
,CompoundBinaryTag.Builder
public interface CompoundTagSetter<R>
Common methods between
CompoundBinaryTag
and CompoundBinaryTag.Builder
.- Since:
- 4.0.0
-
Method Summary
Modifier and Type Method Description @NonNull R
put(@NonNull String key, @NonNull BinaryTag tag)
Inserts a tag.@NonNull R
put(@NonNull Map<String,? extends BinaryTag> tags)
Inserts some tags.@NonNull R
put(@NonNull CompoundBinaryTag tag)
Inserts the tags intag
, overwriting any that are inthis
.default @NonNull R
putBoolean(@NonNull String key, boolean value)
Inserts a boolean.default @NonNull R
putByte(@NonNull String key, byte value)
Inserts a byte.default @NonNull R
putByteArray(@NonNull String key, byte @NonNull [] value)
Inserts an array of bytes.default @NonNull R
putDouble(@NonNull String key, double value)
Inserts a double.default @NonNull R
putFloat(@NonNull String key, float value)
Inserts a float.default @NonNull R
putInt(@NonNull String key, int value)
Inserts an int.default @NonNull R
putIntArray(@NonNull String key, int @NonNull [] value)
Inserts an array of ints.default @NonNull R
putLong(@NonNull String key, long value)
Inserts a long.default @NonNull R
putLongArray(@NonNull String key, long @NonNull [] value)
Inserts an array of longs.default @NonNull R
putShort(@NonNull String key, short value)
Inserts a short.default @NonNull R
putString(@NonNull String key, @NonNull String value)
Inserts a string.default @NonNull R
remove(@NonNull String key)
Removes a tag.@NonNull R
remove(@NonNull String key, @Nullable Consumer<? super BinaryTag> removed)
Removes a tag.
-
Method Details
-
put
Inserts a tag.- Parameters:
key
- the keytag
- the tag- Returns:
- a compound tag
- Since:
- 4.0.0
-
put
Inserts the tags intag
, overwriting any that are inthis
.- Parameters:
tag
- the tag- Returns:
- a compound tag
- Since:
- 4.6.0
-
put
Inserts some tags.- Parameters:
tags
- the tags- Returns:
- a compound tag
- Since:
- 4.4.0
-
remove
Removes a tag.- Parameters:
key
- the key- Returns:
- a compound tag
- Since:
- 4.4.0
-
remove
Removes a tag.- Parameters:
key
- the keyremoved
- a consumer that accepts the removed tag- Returns:
- a compound tag
- Since:
- 4.4.0
-
putBoolean
Inserts a boolean.Booleans are stored as a
ByteBinaryTag
with a value of0
forfalse
and1
fortrue
.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putByte
Inserts a byte.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putShort
Inserts a short.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putInt
Inserts an int.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putLong
Inserts a long.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putFloat
Inserts a float.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putDouble
Inserts a double.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putByteArray
Inserts an array of bytes.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putString
Inserts a string.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putIntArray
Inserts an array of ints.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-
putLongArray
Inserts an array of longs.- Parameters:
key
- the keyvalue
- the value- Returns:
- a compound tag
- Since:
- 4.0.0
-