@Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { fontRenderer.drawString(StatCollector.translateToLocal("crafters.Smeltery"), 86, 5, 0x404040); fontRenderer.drawString( StatCollector.translateToLocal("container.inventory"), 90, (ySize - 96) + 2, 0x404040); int base = 0; int cornerX = (width - xSize) / 2 + 36; int cornerY = (height - ySize) / 2; FluidTankInfo[] info = logic.getTankInfo(ForgeDirection.UNKNOWN); int capacity = 0; for (int i = 0; i < info.length - 1; i++) { FluidStack liquid = info[i].fluid; if (liquid != null) capacity += info[i].capacity; } for (int i = 0; i < info.length - 1; i++) { FluidStack liquid = info[i].fluid; int basePos = 54; int initialLiquidSize = 0; int liquidSize = 0; if (capacity > 0) { liquidSize = liquid.amount * 52 / capacity; if (liquidSize == 0) liquidSize = 1; base += liquidSize; } int leftX = cornerX + basePos; int topY = (cornerY + 68) - base; int sizeX = 52; int sizeY = liquidSize; if (mouseX >= leftX && mouseX <= leftX + sizeX && mouseY >= topY && mouseY < topY + sizeY) { drawFluidStackTooltip(liquid, mouseX - cornerX + 36, mouseY - cornerY); } } if (scomp.fuelGague > 0) { int leftX = cornerX + 117; int topY = (cornerY + 68) - scomp.getScaledFuelGague(52); int sizeX = 12; int sizeY = scomp.getScaledFuelGague(52); if (mouseX >= leftX && mouseX <= leftX + sizeX && mouseY >= topY && mouseY < topY + sizeY) { drawFluidStackTooltip( new FluidStack(-37, scomp.fuelAmount), mouseX - cornerX + 36, mouseY - cornerY); } } }
public List getLiquidTooltip(FluidStack liquid, boolean par2) { ArrayList list = new ArrayList(); if (liquid.fluidID == -37) { list.add("\u00A7fFuel"); list.add("mB: " + liquid.amount); } else { String name = StatCollector.translateToLocal(FluidRegistry.getFluidName(liquid)); list.add("\u00A7f" + name); if (name.equals("liquified emerald")) { list.add("Emeralds: " + liquid.amount / 320f); } else if (name.contains("Molten")) { int ingots = liquid.amount / TConstruct.ingotLiquidValue; if (ingots > 0) list.add("Ingots: " + ingots); int mB = liquid.amount % TConstruct.ingotLiquidValue; if (mB > 0) { int nuggets = mB / TConstruct.nuggetLiquidValue; int junk = (mB % TConstruct.nuggetLiquidValue); if (nuggets > 0) list.add("Nuggets: " + nuggets); if (junk > 0) list.add("mB: " + junk); } } else if (name.equals("Seared Stone")) { int ingots = liquid.amount / TConstruct.ingotLiquidValue; if (ingots > 0) list.add("Blocks: " + ingots); int mB = liquid.amount % TConstruct.ingotLiquidValue; if (mB > 0) list.add("mB: " + mB); } else if (name.equals("Molten Glass")) { int blocks = liquid.amount / 1000; if (blocks > 0) list.add("Blocks: " + blocks); int panels = (liquid.amount % 1000) / 250; if (panels > 0) list.add("Panels: " + panels); int mB = (liquid.amount % 1000) % 250; if (mB > 0) list.add("mB: " + mB); } else { list.add("mB: " + liquid.amount); } } return list; }