public ITextComponent getChatComponent() { return new TextComponentTranslation(contents(), getPath()) .appendSibling(new TextComponentTranslation(getMessage(), args)); } }
@NotNull @Override public ITextComponent getShortDisplayString() { final ITextComponent result = new NonSiblingFormattingTextComponent(); result.appendSibling(new TextComponentTranslation(TranslationConstants.COM_MINECOLONIES_REQUESTS_DELIVERY).appendSibling( new TextComponentString(getRequest().getStack().getCount() + " ")).appendSibling(getRequest().getStack().getTextComponent())); return result; }
boolean allowed = cmd.checkPermission(server, sender); String color = "" + (allowed ? TextFormatting.GREEN : TextFormatting.DARK_RED); tc.appendSibling(new TextComponentString("\n" + color + cmd.getName() + " ")); TextComponentTranslation tt = new TextComponentTranslation(cmd.getCommandDescription(sender)); tt.getStyle().setColor(TextFormatting.GRAY); tt.getStyle().setUnderlined(false); tc.appendSibling(tt); tc.appendSibling(new TextComponentString("" + TextFormatting.RESET));
public ITextComponent getDisplayName(ItemStack stack) { return new TextComponentTranslation(getUnlocalizedName() + ".name").appendSibling(new TextComponentString(" ")).appendSibling(new TextComponentTranslation("text.vampirism.for_level")).appendSibling(new TextComponentString(" " + HunterLevelingConf.instance().getLevelForHunterIntelMeta(stack.getMetadata()))); }
/** * Compile the specified lines of code, assuming this was issued by the * specified player (for notifications on errors). The code will be * compiled into the module's machine state. On errors, the state will * be left in a reset state. * * @param code the code to compile. * @param player the player that issued the compile. */ private void compile(final Iterable<String> code, final EntityPlayer player) { compileError = null; try { getState().clear(); Compiler.compile(code, getState()); } catch (final ParseException e) { compileError = e; player.sendMessage(new TextComponentTranslation(Constants.MESSAGE_COMPILE_ERROR, e.getLineNumber(), e.getStart(), e.getEnd()).appendSibling(new TextComponentTranslation(e.getMessage()))); } }
@Nonnull @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) { ItemStack stack = playerIn.getHeldItem(handIn); if (!worldIn.isRemote) { if (Configs.disable_fang_infection) { playerIn.sendStatusMessage(new TextComponentTranslation("text.vampirism.deactivated_by_serveradmin"), true); } else { if (Helper.canBecomeVampire(playerIn)) { PotionSanguinare.addRandom(playerIn, true); playerIn.addPotionEffect(new PotionEffect(MobEffects.POISON, 60)); } else { if (Helper.isVampire(playerIn)) { playerIn.sendMessage(new TextComponentTranslation("text.vampirism.already_vampire")); } else { playerIn.sendMessage(new TextComponentTranslation("text.vampirism.immune_to").appendSibling(new TextComponentTranslation(ModPotions.sanguinare.getName()))); } } stack.shrink(1); } } return new ActionResult<>(EnumActionResult.SUCCESS, stack); }