private static ITextComponent formatNBT(String str) { TextComponentString chatcomponenttext = new TextComponentString(""); Object object = new TextComponentString(str); chatcomponenttext.appendSibling((ITextComponent) object); return chatcomponenttext; }
@Override public ITextComponent getDeathMessage(EntityLivingBase entityLivingBaseIn) { String s = "death.attack.dragon_fire"; String s1 = s + ".player_" + new Random().nextInt(2); return new TextComponentString(entityLivingBaseIn.getDisplayName().getFormattedText() + " ").appendSibling(new TextComponentTranslation(s1, new Object[]{entityLivingBaseIn.getDisplayName()})); } }.setFireDamage();
@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()})); } };
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; }
@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 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();
private List<ITextComponent> getStatus(IFluidTank tank) { FluidStack stack = tank.getFluid(); if (stack == null) { return Collections.emptyList(); } return Collections.singletonList(new TextComponentString(API.instance().getQuantityFormatter().format(stack.amount) + " mB ").appendSibling(new TextComponentTranslation(stack.getUnlocalizedName()))); }
private List<ITextComponent> getStatus(IItemHandler handler) { List<ITextComponent> components = new ArrayList<>(); for (int i = 0; i < handler.getSlots(); ++i) { ItemStack stack = handler.getStackInSlot(i); if (!stack.isEmpty()) { components.add(new TextComponentString(stack.getCount() + "x ").appendSibling(new TextComponentTranslation(stack.getTranslationKey() + ".name"))); } } return components; }
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.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);
public static ITextComponent getGroupComponent(String group) { if (group.equals(level0)) { ITextComponent nameComponent = new TextComponentString("[") .appendSibling(new TextComponentTranslation("psimisc.fakeLevel.psidust")) .appendText("]"); nameComponent.getStyle().setColor(TextFormatting.AQUA); nameComponent.getStyle().setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponentTranslation("psimisc.levelDisplay", 0))); return nameComponent; } PieceGroup pieceGroup = PsiAPI.groupsForName.get(group); if (pieceGroup == null) { ITextComponent errorComponent = new TextComponentString("ERROR"); errorComponent.getStyle().setColor(TextFormatting.RED); return errorComponent; } ITextComponent nameComponent = new TextComponentString("[") .appendSibling(new TextComponentTranslation(pieceGroup.getUnlocalizedName())) .appendText("]"); nameComponent.getStyle().setColor(TextFormatting.AQUA); nameComponent.getStyle().setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponentTranslation("psimisc.levelDisplay", pieceGroup.levelRequirement))); return nameComponent; }
ITextComponent component = new TextComponentString("#" + StringUtils.add0s(i + 1, players.size()) + " ").appendSibling(p.getDisplayName()).appendText(": "); component.appendSibling(leaderboard.createValue(p));
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);
@Override public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { if (!Ranks.isActive()) { throw FTBLib.error(sender, "feature_disabled_server"); } ForgePlayer p = CommandUtils.getSelfOrOther(sender, args, 0); Rank rank = Ranks.INSTANCE.getRank(p.team.universe.server, p.getProfile(), p.getContext()); ITextComponent component = new TextComponentString("").appendSibling(StringUtils.color(p.getDisplayName(), TextFormatting.BLUE)).appendText(" - "); if (rank != Ranks.INSTANCE.getSetRank(p.getProfile())) { component = component.appendSibling(StringUtils.color(rank.getDisplayName(), TextFormatting.DARK_GRAY)); } else { component = component.appendSibling(rank.getDisplayName()); } sender.sendMessage(component); } }
player.sendStatusMessage(new TextComponentString(TextFormatting.RED.toString()).appendSibling(new TextComponentTranslation("betterquesting.gui.full_lives")), true);