Package net.minecraft.text
Class Style.Serializer
java.lang.Object
net.minecraft.text.Style.Serializer
- All Implemented Interfaces:
JsonDeserializer<Style>,JsonSerializer<Style>
- Enclosing class:
- Style
public static class Style.Serializer extends Object implements JsonDeserializer<Style>, JsonSerializer<Style>
A JSON serializer for
Style.-
Constructor Summary
Constructors Constructor Description Serializer() -
Method Summary
Modifier and Type Method Description Styledeserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext)private static ClickEventgetClickEvent(JsonObject root)private static IdentifiergetFont(JsonObject root)private static HoverEventgetHoverEvent(JsonObject root)private static TextColorparseColor(JsonObject root)private static StringparseInsertion(JsonObject root)private static BooleanparseNullableBoolean(JsonObject root, String key)JsonElementserialize(Style style, Type type, JsonSerializationContext jsonSerializationContext)
-
Constructor Details
-
Serializer
public Serializer()
-
-
Method Details
-
deserialize
@Nullable public Style deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException- Specified by:
deserializein interfaceJsonDeserializer<Style>- Throws:
JsonParseException
-
getFont
-
getHoverEvent
-
getClickEvent
-
parseInsertion
-
parseColor
-
parseNullableBoolean
-
serialize
@Nullable public JsonElement serialize(Style style, Type type, JsonSerializationContext jsonSerializationContext)- Specified by:
serializein interfaceJsonSerializer<Style>
-