コード例 #1
0
  @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);
      }
    }
  }
コード例 #2
0
 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;
 }
コード例 #3
0
  @Override
  public void renderContentLayer(int localWidth, int localHeight, boolean isTranslatable) {
    String tStation = StatCollector.translateToLocal("manual.page.modifier1");
    if (icons.length > 3) tStation = StatCollector.translateToLocal("manual.page.modifier2");
    if (icons.length > 4) tStation = StatCollector.translateToLocal("manual.page.modifier3");
    if (isTranslatable) tStation = StatCollector.translateToLocal(tStation);
    manual.fonts.drawString("\u00a7n" + tStation, localWidth + 60, localHeight + 4, 0);
    GL11.glScalef(2f, 2f, 2f);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    RenderHelper.enableGUIStandardItemLighting();

    ItemStack toolstack = MantleClientRegistry.getManualIcon("ironpick");
    if (type.equals("weapon")) toolstack = MantleClientRegistry.getManualIcon("ironlongsword");
    if (type.equals("travelgoggles"))
      toolstack = MantleClientRegistry.getManualIcon("travelgoggles");
    if (type.equals("travelvest")) toolstack = MantleClientRegistry.getManualIcon("travelvest");
    if (type.equals("travelwings")) toolstack = MantleClientRegistry.getManualIcon("travelwings");
    if (type.equals("travelboots")) toolstack = MantleClientRegistry.getManualIcon("travelboots");
    if (type.equals("travelbelt")) toolstack = MantleClientRegistry.getManualIcon("travelbelt");
    if (type.equals("travelglove")) toolstack = MantleClientRegistry.getManualIcon("travelglove");
    if (type.equals("travelmulti")) toolstack = toolMulti[counter];

    // update displayed item
    if (iconsMulti != null
        && iconsMulti.length > 0
        && type.equals("travelmulti")
        && System.currentTimeMillis() - lastUpdate > 1000) {
      lastUpdate = System.currentTimeMillis();
      counter++;
      if (counter >= iconsMulti.length) counter = 0;
      icons = iconsMulti[counter];
      toolstack = toolMulti[counter];
    }

    manual.renderitem.zLevel = 100;
    if (icons.length < 4) {
      manual.renderitem.renderItemAndEffectIntoGUI(
          manual.fonts,
          manual.getMC().renderEngine,
          toolstack,
          (localWidth + 54) / 2,
          (localHeight + 54) / 2);
      manual.renderitem.renderItemAndEffectIntoGUI(
          manual.fonts,
          manual.getMC().renderEngine,
          icons[0],
          (localWidth + 130) / 2,
          (localHeight + 54) / 2);
      manual.renderitem.renderItemAndEffectIntoGUI(
          manual.fonts,
          manual.getMC().renderEngine,
          icons[1],
          (localWidth + 18) / 2,
          (localHeight + 36) / 2);
      if (icons[2] != null)
        manual.renderitem.renderItemAndEffectIntoGUI(
            manual.fonts,
            manual.getMC().renderEngine,
            icons[2],
            (localWidth + 18) / 2,
            (localHeight + 74) / 2);
    } else {
      manual.renderitem.renderItemAndEffectIntoGUI(
          manual.fonts,
          manual.getMC().renderEngine,
          toolstack,
          (localWidth + 74) / 2,
          (localHeight + 54) / 2);
      manual.renderitem.renderItemAndEffectIntoGUI(
          manual.fonts,
          manual.getMC().renderEngine,
          icons[0],
          (localWidth + 140) / 2,
          (localHeight + 54) / 2);
      manual.renderitem.renderItemAndEffectIntoGUI(
          manual.fonts,
          manual.getMC().renderEngine,
          icons[1],
          (localWidth - 2) / 2,
          (localHeight + 36) / 2);
      manual.renderitem.renderItemAndEffectIntoGUI(
          manual.fonts,
          manual.getMC().renderEngine,
          icons[2],
          (localWidth - 2) / 2,
          (localHeight + 74) / 2);
      manual.renderitem.renderItemAndEffectIntoGUI(
          manual.fonts,
          manual.getMC().renderEngine,
          icons[3],
          (localWidth + 36) / 2,
          (localHeight + 36) / 2);
      if (icons[4] != null)
        manual.renderitem.renderItemAndEffectIntoGUI(
            manual.fonts,
            manual.getMC().renderEngine,
            icons[4],
            (localWidth + 36) / 2,
            (localHeight + 74) / 2);
    }
    manual.renderitem.zLevel = 0;

    GL11.glScalef(0.5F, 0.5F, 0.5F);
    RenderHelper.disableStandardItemLighting();
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
  }