Esempio n. 1
0
public class GUIRelayMK3 extends GuiContainer {
  private final ResourceLocation texture =
      new ResourceLocation(MozeCore.MODID.toLowerCase(), "textures/gui/relay3.png");
  private RelayMK3Tile tile;

  public GUIRelayMK3(InventoryPlayer invPlayer, RelayMK3Tile tile) {
    super(new RelayMK3Container(invPlayer, tile));
    this.tile = tile;
    this.xSize = 212;
    this.ySize = 194;
  }

  @Override
  protected void drawGuiContainerForegroundLayer(int var1, int var2) {
    this.fontRendererObj.drawString("Relay MK3", 38, 6, 4210752);
    this.fontRendererObj.drawString(Integer.toString(tile.displayEmc), 125, 39, 4210752);
  }

  @Override
  protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
    GL11.glColor4f(1F, 1F, 1F, 1F);
    Minecraft.getMinecraft().renderEngine.bindTexture(texture);

    int x = (width - xSize) / 2;
    int y = (height - ySize) / 2;

    this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);

    // Emc bar progress
    int progress = tile.getEmcScaled(102);
    this.drawTexturedModalRect(x + 105, y + 6, 30, 195, progress, 10);

    // Klein start bar progress. Max is 30.
    progress = tile.getKleinEmcScaled(30);
    this.drawTexturedModalRect(x + 153, y + 82, 0, 195, progress, 10);

    // Burn Slot bar progress. Max is 30.
    progress = tile.getRawEmcScaled(30);
    drawTexturedModalRect(x + 101, y + 82, 0, 195, progress, 10);
  }
}
public class GUIAlchChest extends GuiContainer {
  private final ResourceLocation texture =
      new ResourceLocation(MozeCore.MODID.toLowerCase(), "textures/gui/alchchest.png");

  public GUIAlchChest(InventoryPlayer invPlayer, AlchChestTile tile) {
    super(new AlchChestContainer(invPlayer, tile));
    this.xSize = 255;
    this.ySize = 230;
  }

  public GUIAlchChest(InventoryPlayer invPlayer, AlchBagInventory invBag) {
    super(new AlchBagContainer(invPlayer, invBag));
    this.xSize = 255;
    this.ySize = 230;
  }

  @Override
  protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
    GL11.glColor4f(1F, 1F, 1F, 1F);
    Minecraft.getMinecraft().renderEngine.bindTexture(texture);
    this.drawTexturedModalRect((width - xSize) / 2, (height - ySize) / 2, 0, 0, xSize, ySize);
  }
}