コード例 #1
0
  @Override
  protected void drawGuiContainerForegroundLayer(int par1, int par2) {
    super.drawGuiContainerForegroundLayer(par1, par2);

    String title = StringUtil.localize("tile.builderBlock");
    fontRenderer.drawString(title, getCenteredOffset(title), 12, 0x404040);
    fontRenderer.drawString(StringUtil.localize("gui.building.resources"), 8, 60, 0x404040);
    fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, ySize - 97, 0x404040);

    if (builder.isBuildingBlueprint())
      fontRenderer.drawString(StringUtil.localize("gui.needed"), 185, 7, 0x404040);

    drawForegroundSelection();
  }
コード例 #2
0
  @Override
  protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
    int i = 0;
    int j = (width - xSize) / 2;
    int k = (height - ySize) / 2;
    int realXSize = 0;

    if (builder.isBuildingBlueprint()) {
      i = mc.renderEngine.getTexture(DefaultProps.TEXTURE_PATH_GUI + "/builder_blueprint.png");
      realXSize = 256;
    } else {
      i = mc.renderEngine.getTexture(DefaultProps.TEXTURE_PATH_GUI + "/builder.png");
      realXSize = 176;
    }

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    mc.renderEngine.bindTexture(i);

    drawTexturedModalRect(j, k, 0, 0, realXSize, ySize);

    for (int s = 0; s < slots.length; ++s) ((ItemSlot) slots[s]).stack = null;

    Collection<ItemStack> needs = builder.getNeededItems();

    if (needs != null) {
      int s = 0;

      for (ItemStack stack : needs) {
        if (s >= slots.length) break;

        ((ItemSlot) slots[s]).stack = stack.copy();
        s++;
      }
    }

    drawBackgroundSlots();
  }