9
9
import net .minecraft .util .text .Style ;
10
10
import net .minecraft .util .text .TextComponentString ;
11
11
import net .minecraft .util .text .TextComponentTranslation ;
12
- import net .minecraft .util .text .translation .I18n ;
13
12
import net .minecraftforge .fml .relauncher .Side ;
14
13
import net .minecraftforge .fml .relauncher .SideOnly ;
15
14
@@ -34,9 +33,9 @@ public ITextComponent build() {
34
33
chat = new TextComponentTranslation (this .text , this .params );
35
34
else {
36
35
String s ;
37
- if (this .useTranslation )
38
- s = String .format (I18n . translateToLocal (this .text ), this .params );
39
- else
36
+ if (this .useTranslation ) {
37
+ s = String .format (translateToLocal (this .text ), this .params );
38
+ } else
40
39
s = this .text ;
41
40
42
41
if (this .useJson )
@@ -52,10 +51,16 @@ public ITextComponent build() {
52
51
chat = this .chat ;
53
52
}
54
53
if (chat !=null && this .style !=null )
55
- chat .setChatStyle (this .style );
54
+ chat .setStyle (this .style );
56
55
return chat ;
57
56
}
58
57
58
+ @ SideOnly (Side .CLIENT )
59
+ @ SuppressWarnings ("deprecation" )
60
+ public static String translateToLocal (final String text ) {
61
+ return net .minecraft .util .text .translation .I18n .translateToLocal (text );
62
+ }
63
+
59
64
public ChatBuilder setId (final int id ) {
60
65
this .useId = true ;
61
66
this .id = id ;
@@ -129,4 +134,4 @@ public static void sendServerChat(final ChatBuilder chat) {
129
134
// final ServerConfigurationManager sender = FMLCommonHandler.instance().getMinecraftServerInstance().();
130
135
// sender.sendChatMsg(chat.build());
131
136
}
132
- }
137
+ }
0 commit comments