@Override public String toString() { String name1 = inputFluid.getLocalizedName(); String name2 = outputFluid.getLocalizedName(); return name1 + " (" + this.getRequiredAmount() + " mB) + [" + minTorque + " Nm & " + minPower + "W] -> " + name2 + " (" + this.getProductionAmount() + " mB)"; }
private static String getFluidName(FluidStack fluidStack) { final Fluid fluid = fluidStack.getFluid(); String localizedName = fluid.getLocalizedName(fluidStack); if (!Strings.isNullOrEmpty(localizedName) && !localizedName.equals(fluid.getUnlocalizedName())) { return fluid.getRarity(fluidStack).rarityColor.toString() + localizedName; } else { return EnumChatFormatting.OBFUSCATED + "LOLNOPE" + EnumChatFormatting.RESET; } }
public ArrayList<String> getDisplayTags(NBTTagCompound nbt) { ArrayList li = new ArrayList(); Fluid f = ReikaNBTHelper.getFluidFromNBT(nbt); if (f != null) { String fluid = f.getLocalizedName(); int amt = nbt.getInteger("lvl"); if (amt > 0) { String amount = String.format("%d", amt / 1000); String contents = "Contents: " + amount + "B of " + fluid; li.add(contents); } } return li; }
public static String getFluidName(Fluid fluid) { String name = "" + END; if (fluid.getRarity() == EnumRarity.uncommon) { name += YELLOW; } else if (fluid.getRarity() == EnumRarity.rare) { name += BRIGHT_BLUE; } else if (fluid.getRarity() == EnumRarity.epic) { name += PINK; } name += fluid.getLocalizedName() + END; return name; }
@Override @SideOnly(Side.CLIENT) public void addInformation( ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { if (par1ItemStack != null) { String mobName = getMobTypeFromStack(par1ItemStack); if (mobName != null) { par3List.add(EntityUtil.getDisplayNameForEntity(mobName)); } else { par3List.add(EnderIO.lang.localize("item.itemSoulVessel.tooltip.empty")); } float health = getHealthFromStack(par1ItemStack); if (health >= 0) { float maxHealth = getMaxHealthFromStack(par1ItemStack); String msg = EnderIO.lang.localize("item.itemSoulVessel.tooltip.health"); if (maxHealth >= 0) { par3List.add(String.format("%s %3.1f/%3.1f", msg, health, maxHealth)); } else { par3List.add(String.format("%s %3.1f", msg, health)); } } String fluidName = getFluidNameFromStack(par1ItemStack); if (fluidName != null) { Fluid fluid = FluidRegistry.getFluid(fluidName); if (fluid != null) { par3List.add( EnderIO.lang.localize("item.itemSoulVessel.tooltip.fluidname") + " " + fluid.getLocalizedName()); } } DyeColor color = getColorFromStack(par1ItemStack); if (color != null) { par3List.add( EnderIO.lang.localize("item.itemSoulVessel.tooltip.color") + " " + color.getLocalisedName()); } } }
@Override public void registerFuel(Fluid fluid, int mLPerBucket) { if (fluid == null) throw new NullPointerException("Fluid can't be null!"); if (mLPerBucket < 0) throw new IllegalArgumentException("mLPerBucket can't be < 0"); if (liquidFuels.containsKey(fluid)) { Log.info( "Overriding liquid fuel entry " + fluid.getLocalizedName(new FluidStack(fluid, 1)) + " (" + fluid.getName() + ") with a fuel value of " + mLPerBucket + " (previously " + liquidFuels.get(fluid) + ")"); if (mLPerBucket == 0) liquidFuels.remove(fluid); } if (mLPerBucket > 0) liquidFuels.put(fluid, mLPerBucket); }
@Override public String getItemStackDisplayName(ItemStack item) { int id = item.getItemDamage(); if (id != 0) { String ret = LiquidRegistry.getName(id), t = getLocalizedName(ret); if (t != null && !t.isEmpty()) return EnumChatFormatting.RESET + t + EnumChatFormatting.RESET; Fluid liquid = FluidRegistry.getFluid(ret); if (liquid != null) ret = liquid.getLocalizedName(); _prefix = true; t = super.getItemStackDisplayName(item); _prefix = false; t = t != null ? t.trim() : ""; ret = (t.isEmpty() ? "" : t + " ") + ret; t = super.getItemStackDisplayName(item); t = t != null ? t.trim() : ""; ret += t.isEmpty() ? " " + getTranslatedBucketName() : " " + t; return ret; } return super.getItemStackDisplayName(item); }
@Override public void refresh() { toolTip.clear(); int amount = 0; if (getFluid() != null && getFluid().amount > 0 && getFluid().getFluid() != null) { Fluid fluidType = getFluidType(); EnumRarity rarity = fluidType.getRarity(); if (rarity == null) rarity = EnumRarity.common; ToolTipLine fluidName = new ToolTipLine(fluidType.getLocalizedName(), rarity.rarityColor); fluidName.setSpacing(2); toolTip.add(fluidName); amount = getFluid().amount; } else { toolTip.add(new ToolTipLine(StringUtil.localize("gui.empty"))); } if (Config.tooltipLiquidAmount) toolTip.add( new ToolTipLine(String.format(Locale.ENGLISH, "%,d / %,d", amount, getCapacity()))); }
private void drawFluids(int recipe) { CentrifugeRecipe r = (CentrifugeRecipe) arecipes.get(recipe); ItemStack in = r.input; FluidStack fs = RecipesCentrifuge.getRecipes().getFluidResult(in); if (fs != null) { Fluid f = fs.getFluid(); IIcon ico = f.getIcon(); float u = ico.getMinU(); float v = ico.getMinV(); float du = ico.getMaxU(); float dv = ico.getMaxV(); ReikaTextureHelper.bindTerrainTexture(); Tessellator v5 = Tessellator.instance; v5.startDrawingQuads(); int x = 147; for (int i = 0; i < 4; i++) { int y = 1 + i * 16; v5.addVertexWithUV(x, y, 0, u, v); v5.addVertexWithUV(x, y + 16, 0, u, dv); v5.addVertexWithUV(x + 16, y + 16, 0, du, dv); v5.addVertexWithUV(x + 16, y, 0, du, v); } v5.addVertexWithUV(x, 65, 0, u, v); v5.addVertexWithUV(x, 68, 0, u, dv); v5.addVertexWithUV(x + 16, 68, 0, du, dv); v5.addVertexWithUV(x + 16, 65, 0, du, v); v5.draw(); FontRenderer fr = Minecraft.getMinecraft().fontRenderer; String s = f.getLocalizedName() + " (" + fs.amount + " mB) (" + RecipesCentrifuge.getRecipes().getFluidChance(in) + "%)"; int l = fr.getStringWidth(s); fr.drawString(s, 166 - l, 70, 0); } }