/** Creates a copy of this component. Almost a deep copy, except the style is shallow-copied. */ public ChatComponentText createCopy() { ChatComponentText var1 = new ChatComponentText(this.text); var1.setChatStyle(this.getChatStyle().createShallowCopy()); Iterator var2 = this.getSiblings().iterator(); while (var2.hasNext()) { IChatComponent var3 = (IChatComponent) var2.next(); var1.appendSibling(var3.createCopy()); } return var1; }
public ChatComponentScore func_179996_i() { ChatComponentScore var1 = new ChatComponentScore(this.field_179999_b, this.field_180000_c); var1.func_179997_b(this.field_179998_d); var1.setChatStyle(this.getChatStyle().createShallowCopy()); Iterator var2 = this.getSiblings().iterator(); while (var2.hasNext()) { IChatComponent var3 = (IChatComponent) var2.next(); var1.appendSibling(var3.createCopy()); } return var1; }
public static void sendNotice(ICommandSender sender, IChatComponent msg, String permission) { ChatComponentTranslation notice = new ChatComponentTranslation("chat.type.admin", sender.getName(), msg.createCopy()); notice.getChatStyle().setColor(EnumChatFormatting.GRAY).setItalic(true); if (NEIServerConfig.canPlayerPerformAction("CONSOLE", permission)) { MinecraftServer.getServer().addChatMessage(notice); } for (EntityPlayer p : ServerUtils.getPlayers()) { if (p == sender) { p.addChatComponentMessage(msg); } else if (NEIServerConfig.canPlayerPerformAction(p.getName(), permission)) { p.addChatComponentMessage(notice); } } }