コード例 #1
0
  @Override
  @SideOnly(Side.CLIENT)
  public void updateProgressBar(int var, int value) {
    super.updateProgressBar(var, value);

    if (var == 100) _dsu.setSideIsOutput(0, value == 1);
    if (var == 101) _dsu.setSideIsOutput(1, value == 1);
    if (var == 102) _dsu.setSideIsOutput(2, value == 1);
    if (var == 103) _dsu.setSideIsOutput(3, value == 1);
    if (var == 104) _dsu.setSideIsOutput(4, value == 1);
    if (var == 105) _dsu.setSideIsOutput(5, value == 1);

    if (var == 200) _tempQuantity = upcastShort(value);
    if (var == 201) _dsu.setQuantity(_tempQuantity | (value << 16));
  }
コード例 #2
0
  @Override
  protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {

    super.drawGuiContainerForegroundLayer(mouseX, mouseY);

    fontRendererObj.drawString(MFRUtil.localize("info.cofh.stored") + ':', 8, 54, 4210752);
    String v = String.valueOf(_dsu.getQuantity());
    fontRendererObj.drawString(v, 8 + maxWidth - fontRendererObj.getStringWidth(v), 80, 4210752);
  }
コード例 #3
0
  @SuppressWarnings("unchecked")
  @Override
  public void initGui() {

    super.initGui();

    maxWidth = fontRendererObj.getStringWidth(String.valueOf(_dsu.getMaxStoredCount()));

    addElement(
        button =
            new ElementButtonManaged(this, 8, 16, 40, 16, "") {

              @Override
              public void onClick() {

                Packets.sendToServer(Packets.ChronotyperButton, _dsu);
              }
            });
  }
コード例 #4
0
  @Override
  public void detectAndSendChanges() {
    super.detectAndSendChanges();
    for (int i = 0; i < crafters.size(); i++) {
      ((ICrafting) crafters.get(i))
          .sendProgressBarUpdate(this, 100, _dsu.getIsSideOutput(0) ? 1 : 0);
      ((ICrafting) crafters.get(i))
          .sendProgressBarUpdate(this, 101, _dsu.getIsSideOutput(1) ? 1 : 0);
      ((ICrafting) crafters.get(i))
          .sendProgressBarUpdate(this, 102, _dsu.getIsSideOutput(2) ? 1 : 0);
      ((ICrafting) crafters.get(i))
          .sendProgressBarUpdate(this, 103, _dsu.getIsSideOutput(3) ? 1 : 0);
      ((ICrafting) crafters.get(i))
          .sendProgressBarUpdate(this, 104, _dsu.getIsSideOutput(4) ? 1 : 0);
      ((ICrafting) crafters.get(i))
          .sendProgressBarUpdate(this, 105, _dsu.getIsSideOutput(5) ? 1 : 0);

      ((ICrafting) crafters.get(i)).sendProgressBarUpdate(this, 200, _dsu.getQuantity());
      ((ICrafting) crafters.get(i)).sendProgressBarUpdate(this, 201, _dsu.getQuantity() >> 16);
    }
  }
コード例 #5
0
  @Override
  protected void updateElementInformation() {

    button.setText(_dsu.isActive() ? "Unlock" : "Lock");
  }