Interface LegacyHoverEventSerializer
-
public interface LegacyHoverEventSerializer
Adapter to convert between modern and legacy hover event formats.- Since:
- 4.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull HoverEvent.ShowEntity
deserializeShowEntity(@NotNull Component input, Codec.Decoder<Component,java.lang.String,? extends java.lang.RuntimeException> componentDecoder)
Convert a legacy hover eventshow_entity
value to its modern format.@NotNull HoverEvent.ShowItem
deserializeShowItem(@NotNull Component input)
Convert a legacy hover eventshow_item
value to its modern format.@NotNull Component
serializeShowEntity(@NotNull HoverEvent.ShowEntity input, Codec.Encoder<Component,java.lang.String,? extends java.lang.RuntimeException> componentEncoder)
Convert a modern hover eventshow_entity
value to its legacy format.@NotNull Component
serializeShowItem(@NotNull HoverEvent.ShowItem input)
Convert a modern hover eventshow_item
value to its legacy format.
-
-
-
Method Detail
-
deserializeShowItem
@NotNull HoverEvent.ShowItem deserializeShowItem(@NotNull @NotNull Component input) throws java.io.IOException
Convert a legacy hover eventshow_item
value to its modern format.- Parameters:
input
- component whose plain-text value is a SNBT string- Returns:
- the deserialized event
- Throws:
java.io.IOException
- if the input is improperly formatted- Since:
- 4.0.0
-
deserializeShowEntity
@NotNull HoverEvent.ShowEntity deserializeShowEntity(@NotNull @NotNull Component input, Codec.Decoder<Component,java.lang.String,? extends java.lang.RuntimeException> componentDecoder) throws java.io.IOException
Convert a legacy hover eventshow_entity
value to its modern format.- Parameters:
input
- component whose plain-text value is a SNBT stringcomponentDecoder
- A decoder that can take a JSON string and return a deserialized component- Returns:
- the deserialized event
- Throws:
java.io.IOException
- if the input is improperly formatted- Since:
- 4.0.0
-
serializeShowItem
@NotNull @NotNull Component serializeShowItem(@NotNull HoverEvent.ShowItem input) throws java.io.IOException
Convert a modern hover eventshow_item
value to its legacy format.- Parameters:
input
- modern hover event- Returns:
- component with the legacy value as a SNBT string
- Throws:
java.io.IOException
- if the input is improperly formatted- Since:
- 4.0.0
-
serializeShowEntity
@NotNull @NotNull Component serializeShowEntity(@NotNull HoverEvent.ShowEntity input, Codec.Encoder<Component,java.lang.String,? extends java.lang.RuntimeException> componentEncoder) throws java.io.IOException
Convert a modern hover eventshow_entity
value to its legacy format.- Parameters:
input
- modern hover eventcomponentEncoder
- An encoder that can take aComponent
and return a JSON string- Returns:
- component with the legacy value as a SNBT string
- Throws:
java.io.IOException
- if the input is improperly formatted- Since:
- 4.0.0
-
-