Package com.avrix.api.server
Class ChatUtils
java.lang.Object
com.avrix.api.server.ChatUtils
A set of tools for chat management
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
White space symbol, used to separate words after applying color, etc. to it. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getColorCode
(float r, float g, float b) Getting the color code for coloring a chat messagestatic String
getColorCode
(int r, int g, int b) Getting the color code for coloring a chat messagestatic String
getColorCode
(zombie.core.Color color) Getting the color code for coloring a chat messagestatic void
sendMessageToAdmins
(String text) Sending a chat message to administratorsstatic void
sendMessageToAll
(String text) Sending a message to a general chat for all usersstatic void
sendMessageToPlayer
(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
-