Package com.avrix.api.server
Class ChatUtils
java.lang.Object
com.avrix.api.server.ChatUtils
A set of tools for chat management
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringWhite space symbol, used to separate words after applying color, etc. to it. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetColorCode(float r, float g, float b) Getting the color code for coloring a chat messagestatic StringgetColorCode(int r, int g, int b) Getting the color code for coloring a chat messagestatic StringgetColorCode(zombie.core.Color color) Getting the color code for coloring a chat messagestatic voidsendMessageToAdmins(String text) Sending a chat message to administratorsstatic voidsendMessageToAll(String text) Sending a message to a general chat for all usersstatic voidsendMessageToPlayer(zombie.core.raknet.UdpConnection playerConnection, String text) Sending a chat message to a specific user
-
Field Details
-
SPACE_SYMBOL
White space symbol, used to separate words after applying color, etc. to it.- See Also:
-
-
Constructor Details
-
ChatUtils
public ChatUtils()
-
-
Method Details
-
getColorCode
Getting the color code for coloring a chat message- Parameters:
r- Red color component in the range 0.0 to 1.0.g- The green color component in the range 0.0 to 1.0.b- The blue component in the range 0.0 to 1.0.- Returns:
- Color code in RGB format.
-
getColorCode
Getting the color code for coloring a chat message- Parameters:
r- Red color component in the range 0 to 255.g- The green color component in the range 0 to 255.b- The blue component in the range 0 to 255.- Returns:
- Color code in RGB format.
-
getColorCode
Getting the color code for coloring a chat message- Parameters:
color- Color object.- Returns:
- Color code in RGB format.
-
sendMessageToAll
Sending a message to a general chat for all users- Parameters:
text- Message text
-
sendMessageToPlayer
public static void sendMessageToPlayer(zombie.core.raknet.UdpConnection playerConnection, String text) Sending a chat message to a specific user- Parameters:
playerConnection- player connectiontext- Message text
-
sendMessageToAdmins
Sending a chat message to administrators- Parameters:
text- Message text
-