1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
package bloodasp.galacticgreg.auxiliary;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
/**
* Method to easily send chat-messages to EntityPlayer
*
* @author Namikon
*
*/
public class PlayerChatHelper {
/**
* Meant for notifications that are being send to an admin/op Color will be GREEN
*
* @param pPlayer
* @param pMessage
*/
public static void SendInfo(ICommandSender pCommandSender, String pMessage) {
pCommandSender.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + pMessage));
}
/**
* Meant for notifications that are being send to an admin/op Color will be RED
*
* @param pPlayer
* @param pMessage
*/
public static void SendError(ICommandSender pCommandSender, String pMessage) {
pCommandSender.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + pMessage));
}
/**
* Meant for notifications that are being send to an admin/op Color will be YELLOW
*
* @param pPlayer
* @param pMessage
*/
public static void SendWarn(ICommandSender pCommandSender, String pMessage) {
pCommandSender.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + pMessage));
}
/**
* Meant for notifications that are being send to an admin/op Color will be GREEN
*
* @param pPlayer
* @param pMessage
*/
public static void SendInfo(EntityPlayer pPlayer, String pMessage) {
pPlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.GREEN + pMessage));
}
/**
* Meant for notifications that are being send to an admin/op Color will be RED
*
* @param pPlayer
* @param pMessage
*/
public static void SendError(EntityPlayer pPlayer, String pMessage) {
pPlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + pMessage));
}
/**
* Meant for notifications that are being send to an admin/op Color will be YELLOW
*
* @param pPlayer
* @param pMessage
*/
public static void SendWarn(EntityPlayer pPlayer, String pMessage) {
pPlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + pMessage));
}
/**
* Meant for ingame notifications that are being send to a player, not an admin/op Color will be DARK_GREEN
*
* @param pPlayer
* @param pMessage
*/
public static void SendNotifyPositive(EntityPlayer pPlayer, String pMessage) {
pPlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_GREEN + pMessage));
}
/**
* Meant for ingame notifications that are being send to a player, not an admin/op Color will be AQUA
*
* @param pPlayer
* @param pMessage
*/
public static void SendNotifyNormal(EntityPlayer pPlayer, String pMessage) {
pPlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + pMessage));
}
/**
* Meant for ingame notifications that are being send to a player, not an admin/op Color will be DARK_PURPLE
*
* @param pPlayer
* @param pMessage
*/
public static void SendNotifyWarning(EntityPlayer pPlayer, String pMessage) {
pPlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_PURPLE + pMessage));
}
}
|