Package com.minecolonies.api.util
Class MessageUtils
java.lang.Object
com.minecolonies.api.util.MessageUtils
Simple class for containing reusable player messaging logic.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classStarting class for the message building.static classstatic enumMessage priority types handle different types of message displays. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MessageUtils.MessageBuilderforCitizen(AbstractEntityCitizen citizen, String keyIn, Object... msg) Appends the citizen name to a message and returns the messagebuilderstatic MessageUtils.MessageBuilderforCitizen(AbstractEntityCitizen citizen, net.minecraft.network.chat.Component component) Appends the citizen name to a message and returns the messagebuilderstatic MessageUtils.MessageBuilderStarts a new message builder.static MessageUtils.MessageBuilderformat(net.minecraft.network.chat.Component component) Starts a new message builder.
-
Constructor Details
-
MessageUtils
public MessageUtils()
-
-
Method Details
-
forCitizen
public static MessageUtils.MessageBuilder forCitizen(AbstractEntityCitizen citizen, String keyIn, Object... msg) Appends the citizen name to a message and returns the messagebuilder- Parameters:
citizen-keyIn-msg-- Returns:
-
forCitizen
public static MessageUtils.MessageBuilder forCitizen(AbstractEntityCitizen citizen, net.minecraft.network.chat.Component component) Appends the citizen name to a message and returns the messagebuilder- Parameters:
citizen-- Returns:
-
format
Starts a new message builder.- Parameters:
key- the translation key.args- the arguments for the translation component.- Returns:
- the message builder instance.
-
format
Starts a new message builder.- Parameters:
component- the component to send.- Returns:
- the message builder instance.
-