本文整理汇总了Java中net.minecraft.util.ChatMessageComponent.func_111059_a方法的典型用法代码示例。如果您正苦于以下问题:Java ChatMessageComponent.func_111059_a方法的具体用法?Java ChatMessageComponent.func_111059_a怎么用?Java ChatMessageComponent.func_111059_a使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.util.ChatMessageComponent
的用法示例。
在下文中一共展示了ChatMessageComponent.func_111059_a方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: func_71563_a
import net.minecraft.util.ChatMessageComponent; //导入方法依赖的package包/类
public void func_71563_a(ICommandSender p_71563_1_, int p_71563_2_, String p_71563_3_, Object ... p_71563_4_) {
boolean var5 = true;
if(p_71563_1_ instanceof TileEntityCommandBlock && !MinecraftServer.func_71276_C().field_71305_c[0].func_82736_K().func_82766_b("commandBlockOutput")) {
var5 = false;
}
ChatMessageComponent var6 = ChatMessageComponent.func_111082_b("chat.type.admin", new Object[]{p_71563_1_.func_70005_c_(), ChatMessageComponent.func_111082_b(p_71563_3_, p_71563_4_)});
var6.func_111059_a(EnumChatFormatting.GRAY);
var6.func_111063_b(Boolean.valueOf(true));
if(var5) {
Iterator var7 = MinecraftServer.func_71276_C().func_71203_ab().field_72404_b.iterator();
while(var7.hasNext()) {
EntityPlayerMP var8 = (EntityPlayerMP)var7.next();
if(var8 != p_71563_1_ && MinecraftServer.func_71276_C().func_71203_ab().func_72353_e(var8.func_70005_c_())) {
var8.func_70006_a(var6);
}
}
}
if(p_71563_1_ != MinecraftServer.func_71276_C()) {
MinecraftServer.func_71276_C().func_70006_a(var6);
}
if((p_71563_2_ & 1) != 1) {
p_71563_1_.func_70006_a(ChatMessageComponent.func_111082_b(p_71563_3_, p_71563_4_));
}
}
示例2: func_111056_a
import net.minecraft.util.ChatMessageComponent; //导入方法依赖的package包/类
public ChatMessageComponent func_111056_a(JsonElement p_111056_1_, Type p_111056_2_, JsonDeserializationContext p_111056_3_) {
ChatMessageComponent var4 = new ChatMessageComponent();
JsonObject var5 = (JsonObject)p_111056_1_;
JsonElement var6 = var5.get("text");
JsonElement var7 = var5.get("translate");
JsonElement var8 = var5.get("color");
JsonElement var9 = var5.get("bold");
JsonElement var10 = var5.get("italic");
JsonElement var11 = var5.get("underlined");
JsonElement var12 = var5.get("obfuscated");
if(var8 != null && var8.isJsonPrimitive()) {
EnumChatFormatting var13 = EnumChatFormatting.func_96300_b(var8.getAsString());
if(var13 == null || !var13.func_96302_c()) {
throw new JsonParseException("Given color (" + var8.getAsString() + ") is not a valid selection");
}
var4.func_111059_a(var13);
}
if(var9 != null && var9.isJsonPrimitive()) {
var4.func_111071_a(Boolean.valueOf(var9.getAsBoolean()));
}
if(var10 != null && var10.isJsonPrimitive()) {
var4.func_111063_b(Boolean.valueOf(var10.getAsBoolean()));
}
if(var11 != null && var11.isJsonPrimitive()) {
var4.func_111081_c(Boolean.valueOf(var11.getAsBoolean()));
}
if(var12 != null && var12.isJsonPrimitive()) {
var4.func_111061_d(Boolean.valueOf(var12.getAsBoolean()));
}
if(var6 != null) {
if(var6.isJsonArray()) {
JsonArray var18 = var6.getAsJsonArray();
Iterator var14 = var18.iterator();
while(var14.hasNext()) {
JsonElement var15 = (JsonElement)var14.next();
if(var15.isJsonPrimitive()) {
var4.func_111079_a(var15.getAsString());
} else if(var15.isJsonObject()) {
var4.func_111073_a(this.func_111056_a(var15, p_111056_2_, p_111056_3_));
}
}
} else if(var6.isJsonPrimitive()) {
var4.func_111079_a(var6.getAsString());
}
} else if(var7 != null && var7.isJsonPrimitive()) {
JsonElement var17 = var5.get("using");
if(var17 != null) {
if(var17.isJsonArray()) {
ArrayList var20 = Lists.newArrayList();
Iterator var19 = var17.getAsJsonArray().iterator();
while(var19.hasNext()) {
JsonElement var16 = (JsonElement)var19.next();
if(var16.isJsonPrimitive()) {
var20.add(var16.getAsString());
} else if(var16.isJsonObject()) {
var20.add(this.func_111056_a(var16, p_111056_2_, p_111056_3_));
}
}
var4.func_111080_a(var7.getAsString(), var20.toArray());
} else if(var17.isJsonPrimitive()) {
var4.func_111080_a(var7.getAsString(), new Object[]{var17.getAsString()});
}
} else {
var4.func_111072_b(var7.getAsString());
}
}
return var4;
}