Search in sources :

Example 1 with IMinWorkingPressure

use of pneumaticCraft.common.tileentity.IMinWorkingPressure in project PneumaticCraft by MineMaarten.

the class GuiPneumaticContainerBase method addProblems.

protected void addProblems(List<String> curInfo) {
    if (te instanceof IRedstoneControlled && !te.redstoneAllows()) {
        IRedstoneControlled redstoneControlled = (IRedstoneControlled) te;
        curInfo.add("gui.tab.problems.redstoneDisallows");
        if (redstoneControlled.getRedstoneMode() == 1) {
            curInfo.add("gui.tab.problems.provideRedstone");
        } else {
            curInfo.add("gui.tab.problems.removeRedstone");
        }
    }
    if (te instanceof IMinWorkingPressure) {
        IMinWorkingPressure minWork = (IMinWorkingPressure) te;
        if (((TileEntityPneumaticBase) te).getPressure(ForgeDirection.UNKNOWN) < minWork.getMinWorkingPressure()) {
            curInfo.add("gui.tab.problems.notEnoughPressure");
            curInfo.add(I18n.format("gui.tab.problems.applyPressure", minWork.getMinWorkingPressure()));
        }
    }
}
Also used : IRedstoneControlled(pneumaticCraft.common.tileentity.IRedstoneControlled) IMinWorkingPressure(pneumaticCraft.common.tileentity.IMinWorkingPressure)

Example 2 with IMinWorkingPressure

use of pneumaticCraft.common.tileentity.IMinWorkingPressure in project PneumaticCraft by MineMaarten.

the class GuiPneumaticContainerBase method drawGuiContainerBackgroundLayer.

@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int i, int j) {
    if (shouldDrawBackground()) {
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        bindGuiTexture();
        int xStart = (width - xSize) / 2;
        int yStart = (height - ySize) / 2;
        drawTexturedModalRect(xStart, yStart, 0, 0, xSize, ySize);
    }
    GL11.glColor4d(1, 1, 1, 1);
    GL11.glDisable(GL11.GL_LIGHTING);
    for (IGuiWidget widget : widgets) {
        widget.render(i, j, partialTicks);
    }
    for (IGuiWidget widget : widgets) {
        widget.postRender(i, j, partialTicks);
    }
    if (pressureStat != null) {
        TileEntityPneumaticBase pneu = (TileEntityPneumaticBase) te;
        Point gaugeLocation = getGaugeLocation();
        if (gaugeLocation != null)
            GuiUtils.drawPressureGauge(fontRendererObj, -1, pneu.CRITICAL_PRESSURE, pneu.DANGER_PRESSURE, te instanceof IMinWorkingPressure ? ((IMinWorkingPressure) te).getMinWorkingPressure() : -1, pneu.getPressure(ForgeDirection.UNKNOWN), gaugeLocation.x, gaugeLocation.y, zLevel);
    }
}
Also used : IGuiWidget(pneumaticCraft.client.gui.widget.IGuiWidget) Point(java.awt.Point) IMinWorkingPressure(pneumaticCraft.common.tileentity.IMinWorkingPressure) Point(java.awt.Point) TileEntityPneumaticBase(pneumaticCraft.common.tileentity.TileEntityPneumaticBase)

Aggregations

IMinWorkingPressure (pneumaticCraft.common.tileentity.IMinWorkingPressure)2 Point (java.awt.Point)1 IGuiWidget (pneumaticCraft.client.gui.widget.IGuiWidget)1 IRedstoneControlled (pneumaticCraft.common.tileentity.IRedstoneControlled)1 TileEntityPneumaticBase (pneumaticCraft.common.tileentity.TileEntityPneumaticBase)1