Search in sources :

Example 1 with BoilerMultiblockData

use of mekanism.common.content.boiler.BoilerMultiblockData in project Mekanism by mekanism.

the class GuiBoilerStats method drawForegroundText.

@Override
protected void drawForegroundText(@Nonnull MatrixStack matrix, int mouseX, int mouseY) {
    drawCenteredText(matrix, MekanismLang.BOILER_STATS.translate(), 0, imageWidth, titleLabelY, titleTextColor());
    BoilerMultiblockData multiblock = tile.getMultiblock();
    drawString(matrix, MekanismLang.BOILER_MAX_WATER.translate(TextUtils.format(multiblock.waterTank.getCapacity())), 8, 26, titleTextColor());
    drawString(matrix, MekanismLang.BOILER_MAX_STEAM.translate(TextUtils.format(multiblock.steamTank.getCapacity())), 8, 35, titleTextColor());
    drawString(matrix, MekanismLang.BOILER_HEAT_TRANSFER.translate(), 8, 49, subheadingTextColor());
    drawString(matrix, MekanismLang.BOILER_HEATERS.translate(multiblock.superheatingElements), 14, 58, titleTextColor());
    drawString(matrix, MekanismLang.BOILER_CAPACITY.translate(TextUtils.format(multiblock.getBoilCapacity())), 8, 72, titleTextColor());
    super.drawForegroundText(matrix, mouseX, mouseY);
}
Also used : BoilerMultiblockData(mekanism.common.content.boiler.BoilerMultiblockData)

Example 2 with BoilerMultiblockData

use of mekanism.common.content.boiler.BoilerMultiblockData in project Mekanism by mekanism.

the class GuiBoilerStats method tick.

@Override
public void tick() {
    super.tick();
    BoilerMultiblockData multiblock = tile.getMultiblock();
    boilGraph.addData(multiblock.lastBoilRate);
    maxGraph.addData(multiblock.lastMaxBoil);
}
Also used : BoilerMultiblockData(mekanism.common.content.boiler.BoilerMultiblockData)

Example 3 with BoilerMultiblockData

use of mekanism.common.content.boiler.BoilerMultiblockData in project Mekanism by mekanism.

the class GuiThermoelectricBoiler method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiInnerScreen(this, 60, 23, 96, 40, () -> {
        BoilerMultiblockData multiblock = tile.getMultiblock();
        return Arrays.asList(MekanismLang.TEMPERATURE.translate(MekanismUtils.getTemperatureDisplay(multiblock.getTotalTemperature(), TemperatureUnit.KELVIN, true)), MekanismLang.BOIL_RATE.translate(TextUtils.format(multiblock.lastBoilRate)), MekanismLang.MAX_BOIL_RATE.translate(TextUtils.format(multiblock.lastMaxBoil)));
    }).jeiCategories(MekanismBlocks.BOILER_CASING.getRegistryName()));
    addButton(new GuiBoilerTab(this, tile, BoilerTab.STAT));
    addButton(new GuiVerticalRateBar(this, new IBarInfoHandler() {

        @Override
        public ITextComponent getTooltip() {
            return MekanismLang.BOIL_RATE.translate(TextUtils.format(tile.getMultiblock().lastBoilRate));
        }

        @Override
        public double getLevel() {
            BoilerMultiblockData multiblock = tile.getMultiblock();
            return Math.min(1, multiblock.lastBoilRate / (double) multiblock.lastMaxBoil);
        }
    }, 44, 13));
    addButton(new GuiVerticalRateBar(this, new IBarInfoHandler() {

        @Override
        public ITextComponent getTooltip() {
            return MekanismLang.MAX_BOIL_RATE.translate(TextUtils.format(tile.getMultiblock().lastMaxBoil));
        }

        @Override
        public double getLevel() {
            BoilerMultiblockData multiblock = tile.getMultiblock();
            return Math.min(1, multiblock.lastMaxBoil * HeatUtils.getWaterThermalEnthalpy() / (multiblock.superheatingElements * MekanismConfig.general.superheatingHeatTransfer.get()));
        }
    }, 164, 13));
    addButton(new GuiGasGauge(() -> tile.getMultiblock().superheatedCoolantTank, () -> tile.getMultiblock().getGasTanks(null), GaugeType.STANDARD, this, 6, 13).setLabel(MekanismLang.BOILER_HEATED_COOLANT_TANK.translateColored(EnumColor.ORANGE)));
    addButton(new GuiFluidGauge(() -> tile.getMultiblock().waterTank, () -> tile.getMultiblock().getFluidTanks(null), GaugeType.STANDARD, this, 26, 13).setLabel(MekanismLang.BOILER_WATER_TANK.translateColored(EnumColor.INDIGO)));
    addButton(new GuiGasGauge(() -> tile.getMultiblock().steamTank, () -> tile.getMultiblock().getGasTanks(null), GaugeType.STANDARD, this, 172, 13).setLabel(MekanismLang.BOILER_STEAM_TANK.translateColored(EnumColor.GRAY)));
    addButton(new GuiGasGauge(() -> tile.getMultiblock().cooledCoolantTank, () -> tile.getMultiblock().getGasTanks(null), GaugeType.STANDARD, this, 192, 13).setLabel(MekanismLang.BOILER_COOLANT_TANK.translateColored(EnumColor.AQUA)));
    addButton(new GuiHeatTab(this, () -> {
        ITextComponent environment = MekanismUtils.getTemperatureDisplay(tile.getMultiblock().lastEnvironmentLoss, TemperatureUnit.KELVIN, false);
        return Collections.singletonList(MekanismLang.DISSIPATED_RATE.translate(environment));
    }));
}
Also used : GuiInnerScreen(mekanism.client.gui.element.GuiInnerScreen) GuiFluidGauge(mekanism.client.gui.element.gauge.GuiFluidGauge) GuiBoilerTab(mekanism.client.gui.element.tab.GuiBoilerTab) IBarInfoHandler(mekanism.client.gui.element.bar.GuiBar.IBarInfoHandler) GuiVerticalRateBar(mekanism.client.gui.element.bar.GuiVerticalRateBar) BoilerMultiblockData(mekanism.common.content.boiler.BoilerMultiblockData) GuiGasGauge(mekanism.client.gui.element.gauge.GuiGasGauge) ITextComponent(net.minecraft.util.text.ITextComponent) GuiHeatTab(mekanism.client.gui.element.tab.GuiHeatTab)

Example 4 with BoilerMultiblockData

use of mekanism.common.content.boiler.BoilerMultiblockData in project Mekanism by mekanism.

the class RenderThermoelectricBoiler method render.

@Override
protected void render(TileEntityBoilerCasing tile, float partialTick, MatrixStack matrix, IRenderTypeBuffer renderer, int light, int overlayLight, IProfiler profiler) {
    if (tile.isMaster()) {
        BoilerMultiblockData multiblock = tile.getMultiblock();
        if (multiblock.isFormed() && multiblock.renderLocation != null && multiblock.upperRenderLocation != null) {
            BlockPos pos = tile.getBlockPos();
            IVertexBuilder buffer = null;
            if (!multiblock.waterTank.isEmpty()) {
                int height = multiblock.upperRenderLocation.getY() - 1 - multiblock.renderLocation.getY();
                if (height >= 1) {
                    FluidRenderData data = new FluidRenderData(multiblock.waterTank.getFluid());
                    data.location = multiblock.renderLocation;
                    data.height = height;
                    data.length = multiblock.length();
                    data.width = multiblock.width();
                    int glow = data.calculateGlowLight(MekanismRenderer.FULL_SKY_LIGHT);
                    matrix.pushPose();
                    matrix.translate(data.location.getX() - pos.getX(), data.location.getY() - pos.getY(), data.location.getZ() - pos.getZ());
                    buffer = renderer.getBuffer(Atlases.translucentCullBlockSheet());
                    Model3D model = ModelRenderer.getModel(data, multiblock.prevWaterScale);
                    MekanismRenderer.renderObject(model, matrix, buffer, data.getColorARGB(multiblock.prevWaterScale), glow, overlayLight, getFaceDisplay(data, model));
                    matrix.popPose();
                    MekanismRenderer.renderValves(matrix, buffer, multiblock.valves, data, pos, glow, overlayLight, isInsideMultiblock(data));
                }
            }
            if (!multiblock.steamTank.isEmpty()) {
                int height = multiblock.renderLocation.getY() + multiblock.height() - 2 - multiblock.upperRenderLocation.getY();
                if (height >= 1) {
                    GasRenderData data = new GasRenderData(multiblock.steamTank.getStack());
                    data.location = multiblock.upperRenderLocation;
                    data.height = height;
                    data.length = multiblock.length();
                    data.width = multiblock.width();
                    if (buffer == null) {
                        buffer = renderer.getBuffer(Atlases.translucentCullBlockSheet());
                    }
                    int glow = data.calculateGlowLight(MekanismRenderer.FULL_SKY_LIGHT);
                    matrix.pushPose();
                    matrix.translate(data.location.getX() - pos.getX(), data.location.getY() - pos.getY(), data.location.getZ() - pos.getZ());
                    Model3D gasModel = ModelRenderer.getModel(data, 1);
                    MekanismRenderer.renderObject(gasModel, matrix, buffer, data.getColorARGB(multiblock.prevSteamScale), glow, overlayLight, getFaceDisplay(data, gasModel));
                    matrix.popPose();
                }
            }
        }
    }
}
Also used : Model3D(mekanism.client.render.MekanismRenderer.Model3D) GasRenderData(mekanism.client.render.data.ChemicalRenderData.GasRenderData) FluidRenderData(mekanism.client.render.data.FluidRenderData) BoilerMultiblockData(mekanism.common.content.boiler.BoilerMultiblockData) BlockPos(net.minecraft.util.math.BlockPos) IVertexBuilder(com.mojang.blaze3d.vertex.IVertexBuilder)

Aggregations

BoilerMultiblockData (mekanism.common.content.boiler.BoilerMultiblockData)4 IVertexBuilder (com.mojang.blaze3d.vertex.IVertexBuilder)1 GuiInnerScreen (mekanism.client.gui.element.GuiInnerScreen)1 IBarInfoHandler (mekanism.client.gui.element.bar.GuiBar.IBarInfoHandler)1 GuiVerticalRateBar (mekanism.client.gui.element.bar.GuiVerticalRateBar)1 GuiFluidGauge (mekanism.client.gui.element.gauge.GuiFluidGauge)1 GuiGasGauge (mekanism.client.gui.element.gauge.GuiGasGauge)1 GuiBoilerTab (mekanism.client.gui.element.tab.GuiBoilerTab)1 GuiHeatTab (mekanism.client.gui.element.tab.GuiHeatTab)1 Model3D (mekanism.client.render.MekanismRenderer.Model3D)1 GasRenderData (mekanism.client.render.data.ChemicalRenderData.GasRenderData)1 FluidRenderData (mekanism.client.render.data.FluidRenderData)1 BlockPos (net.minecraft.util.math.BlockPos)1 ITextComponent (net.minecraft.util.text.ITextComponent)1