@Override public void printRaw(String msg) { for (String part : msg.split("\n")) { this.player.sendMessage(new TextComponentString(part)); } }
public void tellChanges(EntityPlayer player) { if(changes.size() == 0) return; player.sendMessage(new TextComponentTranslation("botaniamisc.adaptativeConfigChanges").setStyle(new Style().setColor(TextFormatting.GOLD))); for(String change : changes) player.sendMessage(new TextComponentString(change).setStyle(new Style().setColor(TextFormatting.LIGHT_PURPLE))); }
private void sendColorized(String msg, TextFormatting formatting) { for (String part : msg.split("\n")) { TextComponentString component = new TextComponentString(part); component.getStyle().setColor(formatting); this.player.sendMessage(component); } }
private static ITextComponent formatNBT(String str) { TextComponentString chatcomponenttext = new TextComponentString(""); Object object = new TextComponentString(str); chatcomponenttext.appendSibling((ITextComponent) object); return chatcomponenttext; }
@Override public void sendLink(String url) { TextComponentString msg = new TextComponentString(url); Style style = msg.getStyle(); style.setColor(TextFormatting.GRAY); style.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, url)); msg.setStyle(style); broadcast(msg); }
private static ITextComponent formatNBT(String[] str, int start) { TextComponentString chatcomponenttext = new TextComponentString(""); for (int j = start; j < str.length; ++j) { if (j > start) { chatcomponenttext.appendText(" "); } Object object = new TextComponentString(str[j]); chatcomponenttext.appendSibling((ITextComponent) object); } return chatcomponenttext; }
TextComponentString chat = new TextComponentString(TextFormatting.GOLD + "[Matter Overdrive] "); Style style = new Style(); chat.appendSibling(new TextComponentTranslation("alert.new_update")).setStyle(style.setColor(TextFormatting.WHITE)); player.sendMessage(chat); chat = new TextComponentString(""); ITextComponent versionName = new TextComponentString(root.get("title").getAsString() + " " + fullVersion + " ").setStyle(new Style().setColor(TextFormatting.AQUA)); chat.appendSibling(versionName); chat.appendText(TextFormatting.WHITE + "["); style.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, Reference.DOWNLOAD_URL)); style.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponentTranslation("info." + Reference.MOD_ID + ".updater.hover").setStyle(new Style().setColor(TextFormatting.YELLOW)))); style.setColor(TextFormatting.GREEN); chat.appendSibling(new TextComponentTranslation("info." + Reference.MOD_ID + ".updater.download")).setStyle(style); chat.appendText(TextFormatting.WHITE + "]"); player.sendMessage(chat); return true;
if (node(color).neighbors().iterator().hasNext()) { noconnections = false; TextComponentString coltxt = new TextComponentString(color.getLocalisedName()); coltxt.getStyle().setColor(dye2chat(color)); TextComponentString chantxt = new TextComponentString("Channel "); chantxt.appendSibling(coltxt); chantxt.appendText(" at " + bc.getX() + "/" + bc.getY() + "/" + bc.getZ()); player.sendMessage(chantxt); for (Node other : node(color).neighbors()) { player.sendMessage(new TextComponentString(" Connected to: " + prettyNode(other))); player.sendMessage(new TextComponentString("No connections at " + bc.getX() + "/" + bc.getY() + "/" + bc.getZ())); player.sendMessage(new TextComponentString("No network at " + bc.getX() + "/" + bc.getY() + "/" + bc.getZ()));
@Override public ITextComponent getDeathMessage(EntityLivingBase entityLivingBaseIn) { String s = "death.attack.dragon"; String s1 = s + ".player_" + new Random().nextInt(2); return new TextComponentString(entityLivingBaseIn.getDisplayName().getFormattedText() + " ").appendSibling(new TextComponentTranslation(s1, new Object[]{entityLivingBaseIn.getDisplayName()})); } };
@Override public void execute(MinecraftServer server, ICommandSender sender, String[] args) { if (!checkPermission(server, sender)) { TextComponentString msg = new TextComponentString("You do not have permission to use this command."); Style style = msg.getStyle(); style.setColor(TextFormatting.GRAY); msg.setStyle(style); sender.sendMessage(msg); return; } executeCommand(sender, args); }
private void checkStr(String str, ICommandSender sender) { if(!I18n.canTranslate(str)) { sender.sendMessage(new TextComponentString("Missing localization for name: " + str)); } } }
private void syncTextboxesToSign() { for (GuiTextField txtNew : txtBoxes) { int id = txtNew.getId() - 700; Style style = this.sign.signText[id].getStyle(); TextComponentString text = new TextComponentString(txtNew.getText()); text.setStyle(style); this.sign.signText[id] = text; } }
@Override public ITextComponent getDeathMessage(EntityLivingBase entityLivingBaseIn) { String s = "death.attack.dragon_ice"; String s1 = s + ".player_" + new Random().nextInt(2); return new TextComponentString(entityLivingBaseIn.getDisplayName().getFormattedText() + " ").appendSibling(new TextComponentTranslation(s1, new Object[]{entityLivingBaseIn.getDisplayName()})); } };
@Override public ITextComponent getDisplayName() { if (hasCustomName()) { return super.getDisplayName(); } TextComponentString nameString = new TextComponentString(getName()); nameString.getStyle().setHoverEvent(getHoverEvent()); nameString.getStyle().setInsertion(getCachedUniqueIdString()); return nameString; }
private void outputMsg( final ICommandSender player, final String string ) { player.sendMessage( new TextComponentString( string ) ); } }
@SubscribeEvent public void onLogin(PlayerEvent.PlayerLoggedInEvent ev) { if(updateStr == null || !MCEF.WARN_UPDATES) return; Style cs = new Style(); cs.setColor(TextFormatting.LIGHT_PURPLE); TextComponentString cct = new TextComponentString(updateStr); cct.setStyle(cs); ev.player.sendMessage(cct); }
@Override public ITextComponent getDeathMessage(EntityLivingBase entityLivingBaseIn) { String s = "death.attack.gorgon"; String s1 = s + ".player_" + new Random().nextInt(2); return new TextComponentString(entityLivingBaseIn.getDisplayName().getFormattedText() + " ").appendSibling(new TextComponentTranslation(s1, new Object[]{entityLivingBaseIn.getDisplayName()})); } }.setDamageBypassesArmor();
public ITextComponent getDisplayName() { Team team = this.getTeam(); String s = this.getCustomNameTag(); if (s != null && !s.isEmpty()) { TextComponentString textcomponentstring = new TextComponentString(ScorePlayerTeam.formatPlayerName(team, s)); textcomponentstring.getStyle().setHoverEvent(this.getHoverEvent()); textcomponentstring.getStyle().setInsertion(this.getCachedUniqueIdString()); return textcomponentstring; } else { if (this.buyingList == null) { this.populateBuyingList(); } TextComponentString itextcomponent = new TextComponentString(this.getName()); itextcomponent.getStyle().setHoverEvent(this.getHoverEvent()); itextcomponent.getStyle().setInsertion(this.getCachedUniqueIdString()); if (team != null) { itextcomponent.getStyle().setColor(team.getColor()); } return itextcomponent; } }
@Override public void call( final MinecraftServer srv, final String[] data, final ICommandSender sender ) { final String[] who = { "Stig Halvorsen", "Josh Ricker", "Jenny \"Othlon\" Sutherland", "Hristo Bogdanov", "BevoLJ" }; sender.sendMessage( new TextComponentString( "Special thanks to " + Joiner.on( ", " ).join( who ) ) ); } }
@Override public void execute(final MinecraftServer server, final ICommandSender sender, final String[] args) throws CommandException { sender.sendMessage(new TextComponentTranslation("biometweaker.msg.listbiomes.output.text").setStyle(new Style().setColor(TextFormatting.AQUA))); final Iterator<Biome> it = Biome.REGISTRY.iterator(); while(it.hasNext()){ final Biome gen = it.next(); if(gen != null){ final String message = new StringBuilder().append(Biome.getIdForBiome(gen)).append(" - ").append(gen.getBiomeName()).toString(); sender.sendMessage(new TextComponentString(message).setStyle(new Style().setColor(TextFormatting.GOLD))); } } }