public static class HoverEvent.Action<T> extends Object
Modifier and Type | Field and Description |
---|---|
private static Map<String,HoverEvent.Action> |
BY_NAME |
private Function<JsonElement,T> |
deserializer |
private Function<Text,T> |
legacyDeserializer |
private String |
name |
private boolean |
parsable |
private Function<T,JsonElement> |
serializer |
static HoverEvent.Action<HoverEvent.EntityContent> |
SHOW_ENTITY |
static HoverEvent.Action<HoverEvent.ItemStackContent> |
SHOW_ITEM |
static HoverEvent.Action<Text> |
SHOW_TEXT |
Constructor and Description |
---|
Action(String name,
boolean parsable,
Function<JsonElement,T> deserializer,
Function<T,JsonElement> serializer,
Function<Text,T> legacyDeserializer) |
Modifier and Type | Method and Description |
---|---|
HoverEvent |
buildHoverEvent(JsonElement contents) |
HoverEvent |
buildHoverEvent(Text value) |
static HoverEvent.Action |
byName(String name) |
private T |
cast(Object o) |
JsonElement |
contentsToJson(Object contents) |
String |
getName() |
boolean |
isParsable() |
String |
toString() |
public static final HoverEvent.Action<Text> SHOW_TEXT
public static final HoverEvent.Action<HoverEvent.ItemStackContent> SHOW_ITEM
public static final HoverEvent.Action<HoverEvent.EntityContent> SHOW_ENTITY
private static final Map<String,HoverEvent.Action> BY_NAME
private final String name
private final boolean parsable
private final Function<JsonElement,T> deserializer
private final Function<T,JsonElement> serializer
public Action(String name, boolean parsable, Function<JsonElement,T> deserializer, Function<T,JsonElement> serializer, Function<Text,T> legacyDeserializer)
public boolean isParsable()
public String getName()
@Nullable public static HoverEvent.Action byName(String name)
@Nullable public HoverEvent buildHoverEvent(JsonElement contents)
@Nullable public HoverEvent buildHoverEvent(Text value)
public JsonElement contentsToJson(Object contents)