1
1
package com .falsepattern .lib .text ;
2
2
3
+ import cpw .mods .fml .relauncher .Side ;
4
+ import cpw .mods .fml .relauncher .SideOnly ;
3
5
import lombok .NonNull ;
4
6
import lombok .val ;
7
+ import net .minecraft .client .entity .EntityOtherPlayerMP ;
8
+ import net .minecraft .client .entity .EntityPlayerSP ;
5
9
import net .minecraft .client .gui .FontRenderer ;
10
+ import net .minecraft .command .ICommandSender ;
11
+ import net .minecraft .command .server .CommandBlockLogic ;
12
+ import net .minecraft .entity .player .EntityPlayerMP ;
13
+ import net .minecraft .network .rcon .RConConsoleSource ;
14
+ import net .minecraft .server .MinecraftServer ;
6
15
import net .minecraft .util .ChatComponentText ;
7
16
import net .minecraft .util .ChatStyle ;
8
17
import net .minecraft .util .EnumChatFormatting ;
@@ -155,12 +164,43 @@ public ChatComponentText toChatText() {
155
164
return result ;
156
165
}
157
166
167
+ public void addChatMessage (ICommandSender target ) {
168
+ target .addChatMessage (this .toChatText ());
169
+ }
170
+
171
+ @ SideOnly (Side .CLIENT )
172
+ public void addChatMessage (EntityOtherPlayerMP target ) {
173
+ target .addChatMessage (this .toChatText ());
174
+ }
175
+
176
+ @ SideOnly (Side .CLIENT )
177
+ public void addChatMessage (EntityPlayerSP target ) {
178
+ target .addChatMessage (this .toChatText ());
179
+ }
180
+
181
+ public void addChatMessage (CommandBlockLogic target ) {
182
+ target .addChatMessage (this .toChatText ());
183
+ }
184
+
185
+ public void addChatMessage (EntityPlayerMP target ) {
186
+ target .addChatMessage (this .toChatText ());
187
+ }
188
+
189
+ public void addChatMessage (RConConsoleSource target ) {
190
+ target .addChatMessage (this .toChatText ());
191
+ }
192
+
193
+ public void addChatMessage (MinecraftServer target ) {
194
+ target .addChatMessage (this .toChatText ());
195
+ }
196
+
158
197
/**
159
198
* {@link #draw(FontRenderer, int, int, boolean)} without drop shadows.
160
199
* @param renderer The font renderer to use
161
200
* @param x Left side
162
201
* @param y Top side
163
202
*/
203
+ @ SideOnly (Side .CLIENT )
164
204
public void draw (FontRenderer renderer , int x , int y ) {
165
205
draw (renderer , x , y , false );
166
206
}
@@ -172,6 +212,7 @@ public void draw(FontRenderer renderer, int x, int y) {
172
212
* @param x Left side
173
213
* @param y Top side
174
214
*/
215
+ @ SideOnly (Side .CLIENT )
175
216
public void drawWithShadow (FontRenderer renderer , int x , int y ) {
176
217
draw (renderer , x , y , true );
177
218
}
@@ -183,6 +224,7 @@ public void drawWithShadow(FontRenderer renderer, int x, int y) {
183
224
* @param y Top side
184
225
* @param shadow Whether to have drop shadow under the text
185
226
*/
227
+ @ SideOnly (Side .CLIENT )
186
228
public void draw (FontRenderer renderer , int x , int y , boolean shadow ) {
187
229
x += renderer .drawString (text , x , y , colorMap .get (colorStyle ).getRGB (), shadow );
188
230
if (endLine )
0 commit comments