Ejemplo n.º 1
0
 @Override
 public void updateScreen() {
   super.updateScreen();
   if (getTileEntity().getWorldObj().getTotalWorldTime() % 20 == 0) {
     refreshButtons();
   }
 }
Ejemplo n.º 2
0
 @Override
 protected void actionPerformed(GuiButton b) {
   super.actionPerformed(b);
   if (b.id >= 0 && b.id <= 2) {
     getTileEntity().startTask(b.id);
     PacketHandler.INSTANCE.sendToServer(
         new PacketActivateWeather(getTileEntity(), WeatherTask.values()[b.id]));
   }
 }
Ejemplo n.º 3
0
  @Override
  public void initGui() {
    super.initGui();

    int x = (xSize / 2) - (BUTTON_SIZE / 2);
    int y = 8;

    addButton(new IconButton(this, 0, x - 30, y, IconEIO.SUN), WeatherTask.CLEAR);
    addButton(new IconButton(this, 1, x, y, IconEIO.RAIN), WeatherTask.RAIN);
    addButton(new IconButton(this, 2, x + 30, y, IconEIO.THUNDER), WeatherTask.STORM);
    refreshButtons();
  }
Ejemplo n.º 4
0
  @Override
  protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    bindGuiTexture();
    int sx = (width - xSize) / 2;
    int sy = (height - ySize) / 2;

    drawTexturedModalRect(sx, sy, 0, 0, xSize, ySize);

    super.drawGuiContainerBackgroundLayer(par1, par2, par3);

    int range = (int) getTileEntity().getRange();
    drawCenteredString(
        fontRendererObj,
        EnderIO.lang.localize("gui.spawnGurad.range") + " " + range,
        getGuiLeft() + sx / 2 + 9,
        getGuiTop() + 68,
        ColorUtil.getRGB(Color.white));
  }
Ejemplo n.º 5
0
  @Override
  protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
    this.mc.renderEngine.bindTexture(texture);

    this.drawTexturedModalRect(getGuiLeft(), getGuiTop(), 0, 0, getXSize(), getYSize());

    if (shouldRenderProgress() && getTileEntity().activeTask != null) {
      // TODO test
      int barHeight = getProgressScaled(ContainerWeatherObelisk.MAX_SCALE);
      Color color = getTileEntity().activeTask.color;
      GL11.glColor3f(
          (float) color.getRed() / 255f,
          (float) color.getGreen() / 255f,
          (float) color.getBlue() / 255f);
      this.drawTexturedModalRect(
          getGuiLeft() + 81,
          getGuiTop() + 58 - barHeight,
          getXSize(),
          32 - barHeight,
          12,
          barHeight);
    }
    super.drawGuiContainerBackgroundLayer(par1, par2, par3);
  }