Package com.samsthenerd.inline.api
Interface InlineAPI
public interface InlineAPI
The common Inline API, mostly just for working with InlineData.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChatMatcher
(InlineMatcher matcher) Register a server-side matcher to be used against chat with aMatchContext.ChatMatchContext
void
addDataType
(InlineData.InlineDataType<?> type) Register an inline data type<D extends InlineData<D>>
DdeserializeData
(com.google.gson.JsonObject json) Parse data from json<D extends InlineData<D>>
com.google.gson.JsonObjectserializeData
(D data) Serialize data to jsonnet.minecraft.text.Style
withSizeModifier
(net.minecraft.text.Style style, double modifier) Attach a size modifier to this style.
-
Field Details
-
INSTANCE
Usable API Instance.
-
-
Method Details
-
addDataType
Register an inline data type- Parameters:
type
-
-
deserializeData
Parse data from json- Parameters:
json
- serialized data- Returns:
- data
-
serializeData
Serialize data to json- Parameters:
data
- data to serialize- Returns:
- serialized data
-
addChatMatcher
Register a server-side matcher to be used against chat with aMatchContext.ChatMatchContext
-
withSizeModifier
net.minecraft.text.Style withSizeModifier(net.minecraft.text.Style style, double modifier) Attach a size modifier to this style. Generally this should be used for some data-holding style to tell the renderer to render it with a different size.- Parameters:
style
- style to attach it to.modifier
- size to scale it by. Ideally should be less than 2.- Returns:
- a new style object with the given size modifier.
-