Ejemplo n.º 1
0
  @Override
  protected void actionPerformed(GuiButton button) {
    super.actionPerformed(button);

    if (button.id == 0) {
      filler.currentPattern =
          (FillerPattern) FillerManager.registry.getPreviousPattern(filler.currentPattern);
    } else if (button.id == 1) {
      filler.currentPattern =
          (FillerPattern) FillerManager.registry.getNextPattern(filler.currentPattern);
    } else if (button.id == 2) {
      filler.setExcavate(!filler.isExcavate());

      buttonList.set(2, getExcavateButton());

      BuildCraftCore.instance.sendToServer(
          new PacketCommand(
              filler,
              "setFlags",
              new CommandWriter() {
                public void write(ByteBuf data) {
                  data.writeBoolean(filler.isExcavate());
                }
              }));
    }

    filler.rpcSetPatternFromString(filler.currentPattern.getUniqueTag());
  }
Ejemplo n.º 2
0
  @Override
  protected void drawGuiContainerForegroundLayer(int mx, int my) {
    super.drawGuiContainerForegroundLayer(mx, my);

    String title = StringUtils.localize("tile.fillerBlock.name");
    fontRendererObj.drawString(title, getCenteredOffset(title), 6, 0x404040);
    fontRendererObj.drawString(StringUtils.localize("gui.filling.resources"), 8, 74, 0x404040);
    fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, 142, 0x404040);
    GuiTools.drawCenteredString(fontRendererObj, filler.currentPattern.getDescription(), 56);

    drawTooltipForSlotAt(mx, my);
  }
Ejemplo n.º 3
0
  @Override
  public void initGui() {
    super.initGui();
    buttonList.clear();

    buttonList.add(
        new GuiBetterButton(
            0, guiLeft + 38 - 18, guiTop + 30, 10, StandardButtonTextureSets.LEFT_BUTTON, ""));
    buttonList.add(
        new GuiBetterButton(
            1, guiLeft + 38 + 16 + 8, guiTop + 30, 10, StandardButtonTextureSets.RIGHT_BUTTON, ""));
    buttonList.add(getExcavateButton());

    slots.clear();
    for (int i = 0; i < 4; i++) {
      slots.add(new FillerParameterSlot(77 + (i * 18), 30, i));
    }
  }
Ejemplo n.º 4
0
  @Override
  protected void mouseClicked(int x, int y, int k) {
    super.mouseClicked(x, y, k);

    AdvancedSlot slot = getSlotAtLocation(x, y);

    if (slot != null) {
      int i = ((FillerParameterSlot) slot).slot;
      if (i < filler.patternParameters.length) {
        if (filler.patternParameters[i] != null) {
          filler.patternParameters[i].onClick(
              filler,
              filler.currentPattern,
              mc.thePlayer.inventory.getItemStack(),
              new StatementMouseClick(k, isShiftKeyDown()));
        } else {
          filler.patternParameters[i] = filler.currentPattern.createParameter(i);
        }
        filler.rpcSetParameter(i, filler.patternParameters[i]);
      }
    }
  }
Ejemplo n.º 5
0
 @Override
 protected void drawGuiContainerBackgroundLayer(float f, int mx, int my) {
   super.drawGuiContainerBackgroundLayer(f, mx, my);
   drawBackgroundSlots();
 }