Package net.minecraft.util.text.event
Class HoverEvent.Action<T>
- java.lang.Object
-
- net.minecraft.util.text.event.HoverEvent.Action<T>
-
- Enclosing class:
- HoverEvent
public static class HoverEvent.Action<T> extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
allowFromServer
private java.util.function.Function<com.google.gson.JsonElement,T>
argDeserializer
private java.util.function.Function<T,com.google.gson.JsonElement>
argSerializer
private java.util.function.Function<ITextComponent,T>
legacyArgDeserializer
private static java.util.Map<java.lang.String,HoverEvent.Action>
LOOKUP
private java.lang.String
name
static HoverEvent.Action<HoverEvent.EntityHover>
SHOW_ENTITY
static HoverEvent.Action<HoverEvent.ItemHover>
SHOW_ITEM
static HoverEvent.Action<ITextComponent>
SHOW_TEXT
-
Constructor Summary
Constructors Constructor Description Action(java.lang.String p_i232565_1_, boolean p_i232565_2_, java.util.function.Function<com.google.gson.JsonElement,T> p_i232565_3_, java.util.function.Function<T,com.google.gson.JsonElement> p_i232565_4_, java.util.function.Function<ITextComponent,T> p_i232565_5_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private T
cast(java.lang.Object p_240674_1_)
HoverEvent
deserialize(com.google.gson.JsonElement p_240668_1_)
HoverEvent
deserializeFromLegacy(ITextComponent p_240670_1_)
static HoverEvent.Action
getByName(java.lang.String p_150684_0_)
java.lang.String
getName()
boolean
isAllowedFromServer()
com.google.gson.JsonElement
serializeArg(java.lang.Object p_240669_1_)
java.lang.String
toString()
-
-
-
Field Detail
-
SHOW_TEXT
public static final HoverEvent.Action<ITextComponent> SHOW_TEXT
-
SHOW_ITEM
public static final HoverEvent.Action<HoverEvent.ItemHover> SHOW_ITEM
-
SHOW_ENTITY
public static final HoverEvent.Action<HoverEvent.EntityHover> SHOW_ENTITY
-
LOOKUP
private static final java.util.Map<java.lang.String,HoverEvent.Action> LOOKUP
-
name
private final java.lang.String name
-
allowFromServer
private final boolean allowFromServer
-
argDeserializer
private final java.util.function.Function<com.google.gson.JsonElement,T> argDeserializer
-
argSerializer
private final java.util.function.Function<T,com.google.gson.JsonElement> argSerializer
-
legacyArgDeserializer
private final java.util.function.Function<ITextComponent,T> legacyArgDeserializer
-
-
Constructor Detail
-
Action
public Action(java.lang.String p_i232565_1_, boolean p_i232565_2_, java.util.function.Function<com.google.gson.JsonElement,T> p_i232565_3_, java.util.function.Function<T,com.google.gson.JsonElement> p_i232565_4_, java.util.function.Function<ITextComponent,T> p_i232565_5_)
-
-
Method Detail
-
isAllowedFromServer
public boolean isAllowedFromServer()
-
getName
public java.lang.String getName()
-
getByName
@Nullable public static HoverEvent.Action getByName(java.lang.String p_150684_0_)
-
cast
private T cast(java.lang.Object p_240674_1_)
-
deserialize
@Nullable public HoverEvent deserialize(com.google.gson.JsonElement p_240668_1_)
-
deserializeFromLegacy
@Nullable public HoverEvent deserializeFromLegacy(ITextComponent p_240670_1_)
-
serializeArg
public com.google.gson.JsonElement serializeArg(java.lang.Object p_240669_1_)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-