Modifier and Type | Method and Description |
---|---|
static <T> StructuredData<T> |
empty(StructuredDataKey<T> key,
int id)
Returns empty structured data, equivalent to an empty Optional in vanilla.
|
boolean |
isEmpty()
Returns whether the structured data is empty.
|
default boolean |
isPresent()
Returns whether the structured data is present.
|
StructuredDataKey<T> |
key() |
static <T> StructuredData<T> |
of(StructuredDataKey<T> key,
T value,
int id)
Returns filled structured data, equivalent to an Optional with a value in vanilla.
|
void |
setId(int id) |
void |
setValue(T value) |
T |
value() |
void |
write(io.netty.buffer.ByteBuf buffer) |
static <T> StructuredData<T> of(StructuredDataKey<T> key, T value, int id)
T
- serializer typekey
- serializer keyvalue
- valueid
- serializer idstatic <T> StructuredData<T> empty(StructuredDataKey<T> key, int id)
key
- serializer keyid
- serializer idvoid setValue(T value)
void write(io.netty.buffer.ByteBuf buffer) throws java.lang.Exception
java.lang.Exception
void setId(int id)
StructuredDataKey<T> key()
T value()
default boolean isPresent()
boolean isEmpty()