@Override public String[] getOverlayText(EntityPlayer player, MovingObjectPosition mop, boolean hammer) { if (Utils.isFluidRelatedItemStack(player.getCurrentEquippedItem())) { FluidStack fs = master() != null ? master().tank.getFluid() : this.tank.getFluid(); String s = null; if (fs != null) s = fs.getLocalizedName() + ": " + fs.amount + "mB"; else s = StatCollector.translateToLocal(Lib.GUI + "empty"); return new String[] {s}; } return null; }
@Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean advInfo) { if (stack.getItemDamage() == 4) list.add(StatCollector.translateToLocal(Lib.DESC_FLAVOUR + "crate")); if (stack.getItemDamage() == 6) { if (stack.hasTagCompound()) { NBTTagCompound tag = stack.getTagCompound().getCompoundTag("tank"); if (!tag.hasKey("Empty")) { FluidStack fluid = FluidStack.loadFluidStackFromNBT(tag); list.add(fluid.getLocalizedName() + ": " + fluid.amount + "mB"); } else { list.add(StatCollector.translateToLocal(Lib.DESC_FLAVOUR + "barrel")); list.add(StatCollector.translateToLocal(Lib.DESC_FLAVOUR + "barrelTemp")); } } else { list.add(StatCollector.translateToLocal(Lib.DESC_FLAVOUR + "barrel")); list.add(StatCollector.translateToLocal(Lib.DESC_FLAVOUR + "barrelTemp")); } } }
@Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) { FluidStack fs = getFluid(stack); if (fs != null) { EnumChatFormatting rarity = fs.getFluid().getRarity() == EnumRarity.COMMON ? EnumChatFormatting.GRAY : fs.getFluid().getRarity().rarityColor; list.add( rarity + fs.getLocalizedName() + EnumChatFormatting.GRAY + ": " + fs.amount + "/" + getCapacity(stack) + "mB"); } else list.add(StatCollector.translateToLocal("desc.ImmersiveEngineering.flavour.drill.empty")); }