@Override public void updateScreen() { super.updateScreen(); if (getTileEntity().getWorldObj().getTotalWorldTime() % 20 == 0) { refreshButtons(); } }
@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])); } }
@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(); }
@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)); }
@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); }