@Override public @Nonnull String getLocalizedName() { return EnderIO.lang.localizeExact(unlocalizedName + ".name"); }
public static @Nonnull String getDisplayNameForEntity(@Nonnull String mobName) { return EnderIO.lang.localizeExact("entity." + mobName + ".name"); }
public static @Nonnull String getDisplayNameForEntity(@Nonnull String mobName) { return EnderCore.lang.localizeExact("entity." + mobName + ".name"); }
public static void addTooltipFromResources(@Nonnull List<String> list, @Nullable /* for String.concat() */ String keyBase) { boolean done = false; int line = 1; while (!done) { String key = keyBase + line; String val = EnderCore.lang.localizeExact(key); if (val.trim().length() < 0 || val.equals(key) || line > 12) { done = true; } else { list.add(val); line++; } } }
/** * Localizes the string passed, first appending the prefix stored in this instance of the class. * * @param unloc * The unlocalized string. * * @return A localized string. */ public @Nonnull String localize(@Nonnull String unloc) { return localizeExact(addPrefix(unloc)); }
public @Nonnull String getDisplayString() { return EnderIOMachines.lang.localizeExact(getUnlocalizedName()); }
/** * Localizes the string passed, first appending the prefix stored in this instance of the class. * * @param unloc * The unlocalized string. * @param args * The args to format the localized text with. * * @return A localized string. */ public @Nonnull String localize(@Nonnull String unloc, @Nonnull Object... args) { return localizeExact(addPrefix(unloc), args); }
@Override @SideOnly(Side.CLIENT) public void addBasicEntries(@Nonnull ItemStack itemstack, @Nullable EntityPlayer entityplayer, @Nonnull List<String> list, boolean flag) { list.add(TextFormatting.DARK_AQUA + EnderIO.lang.localizeExact(getUnlocalizedName() + ".name")); }
public @Nonnull String getDisplayName() { String baseName = EnderIO.lang.localizeExact("entity." + getTranslationName() + ".name"); if (baseName.trim().isEmpty()) { if (customName != null && !customName.trim().isEmpty()) { return NullHelper.notnullJ(customName, "private final field changed its value"); } else { return "???"; } } else { if (customName != null && !customName.trim().isEmpty()) { return customName + " (" + baseName + ")"; } else { return baseName; } } }
/** * Get the detail for this itemstack * * @param stack * @return a list of <code>String</code>s to be bulleted under the enchantment */ default @Nonnull String[] getTooltipDetails(@Nonnull ItemStack stack) { final String unloc = "description." + ((Enchantment) this).getName(); final String loc = EnderCore.lang.localizeExact(unloc); return unloc.equals(loc) ? new String[0] : EnderCore.lang.splitList(loc); }
default @Nonnull String get(@Nonnull Object... params) { return getLang().localizeExact(getKey(), params); }
default @Nonnull String get() { return getLang().localizeExact(getKey()); }
@Override @SideOnly(Side.CLIENT) public void addDetailedEntries(@Nonnull ItemStack itemstack, @Nullable EntityPlayer entityplayer, @Nonnull List<String> list, boolean flag) { list.add(TextFormatting.DARK_AQUA + EnderIO.lang.localizeExact(getUnlocalizedName() + ".name")); SpecialTooltipHandler.addDetailedTooltipFromResources(list, getUnlocalizedName()); }
public @Nonnull String getLocalisedName() { return EnderCore.lang.localizeExact(NullHelper.notnull(DYE_ORE_UNLOCAL_NAMES[ordinal()], "Data corruption"), false); }
default @Nonnull TextComponentString toChat(@Nonnull Object... params) { return new TextComponentString(getLang().localizeExact(getKey(), params)); }
default @Nonnull TextComponentString toChat() { return new TextComponentString(getLang().localizeExact(getKey())); }
@Override @SideOnly(Side.CLIENT) public void addDetailedEntries(@Nonnull ItemStack itemstack, @Nullable EntityPlayer entityplayer, @Nonnull List<String> list, boolean flag) { List<String> upgradeStr = new ArrayList<String>(); upgradeStr.add(TextFormatting.DARK_AQUA + EnderIO.lang.localizeExact(getUnlocalizedName() + ".name")); if (itemstack.isItemStackDamageable() && itemstack.getItem() instanceof IDarkSteelItem) { SpecialTooltipHandler.addDetailedTooltipFromResources(upgradeStr, getUnlocalizedName()); EnergyUpgradeHolder eu = getEnergyUpgradeHolder(itemstack, (IDarkSteelItem) itemstack.getItem()); String percDamage = Math.round(eu.getAbsorptionRatio() * 100) + ""; String capString = LangPower.RF(eu.getCapacity()); for (int i = 0; i < upgradeStr.size(); i++) { String str = upgradeStr.get(i); str = str.replaceAll("\\$P", capString); str = str.replaceAll("\\$D", percDamage); upgradeStr.set(i, str); } } list.addAll(upgradeStr); }
default @Nonnull NNList<String> getLines(@Nonnull Object... params) { NNList<String> result = new NNList<>(); for (int i = 1; i < 12; i++) { final String linekey = getKey() + ".line" + i; if (getLang().canLocalizeExact(linekey)) { result.add(getLang().localizeExact(linekey, params)); } else { return result; } } return result; }
@Override protected void renderTileEntity(@Nonnull TileFarmStation te, @Nonnull IBlockState blockState, float partialTicks, int destroyStage) { float offset = 0; GlStateManager.disableDepth(); for (FarmNotification note : te.getNotification()) { RenderUtil.drawBillboardedText(new Vector3f(0.5, 1.5 + offset, 0.5), EnderIO.lang.localizeExact(note.getUnlocalizedName()), 0.25f); offset += 0.375f; } GlStateManager.enableDepth(); }
public static void addAdvancedTooltipEntries(@Nonnull ItemStack itemstack, EntityPlayer entityplayer, @Nonnull List<String> list, boolean flag) { SpecialTooltipHandler.addDetailedTooltipFromResources(list, itemstack.getUnlocalizedName()); if (itemstack.getItem() instanceof IDarkSteelItem) { List<IDarkSteelUpgrade> applyableUpgrades = new ArrayList<IDarkSteelUpgrade>(); for (IDarkSteelUpgrade upgrade : UpgradeRegistry.getUpgrades()) { if (upgrade instanceof IAdvancedTooltipProvider && upgrade.hasUpgrade(itemstack, (IDarkSteelItem) itemstack.getItem())) { ((IAdvancedTooltipProvider) upgrade).addDetailedEntries(itemstack, entityplayer, list, flag); } else if (upgrade.canAddToItem(itemstack, (IDarkSteelItem) itemstack.getItem())) { applyableUpgrades.add(upgrade); } } if (!applyableUpgrades.isEmpty()) { list.add(TextFormatting.YELLOW + EnderIO.lang.localize("tooltip.anvilupgrades") + " "); for (IDarkSteelUpgrade up : applyableUpgrades) { list.add(Lang.DARK_STEEL_LEVELS1.get(TextFormatting.DARK_AQUA, EnderIO.lang.localizeExact(up.getUnlocalizedName() + ".name"))); list.add(Lang.DARK_STEEL_LEVELS2.get(TextFormatting.DARK_AQUA, TextFormatting.ITALIC, up.getUpgradeItemName(), up.getLevelCost())); } } } }