Search in sources :

Example 1 with EvaporationMultiblockData

use of mekanism.common.content.evaporation.EvaporationMultiblockData in project Mekanism by mekanism.

the class GuiThermalEvaporationController method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiInnerScreen(this, 48, 19, 80, 40, () -> {
        EvaporationMultiblockData multiblock = tile.getMultiblock();
        return Arrays.asList(MekanismLang.MULTIBLOCK_FORMED.translate(), MekanismLang.EVAPORATION_HEIGHT.translate(multiblock.height()), MekanismLang.TEMPERATURE.translate(MekanismUtils.getTemperatureDisplay(multiblock.getTemperature(), TemperatureUnit.KELVIN, true)), MekanismLang.FLUID_PRODUCTION.translate(Math.round(multiblock.lastGain * 100D) / 100D));
    }).spacing(1).jeiCategory(tile));
    addButton(new GuiDownArrow(this, 32, 39));
    addButton(new GuiDownArrow(this, 136, 39));
    addButton(new GuiHorizontalRateBar(this, new IBarInfoHandler() {

        @Override
        public ITextComponent getTooltip() {
            return MekanismUtils.getTemperatureDisplay(tile.getMultiblock().getTemperature(), TemperatureUnit.KELVIN, true);
        }

        @Override
        public double getLevel() {
            return Math.min(1, tile.getMultiblock().getTemperature() / EvaporationMultiblockData.MAX_MULTIPLIER_TEMP);
        }
    }, 48, 63));
    addButton(new GuiFluidGauge(() -> tile.getMultiblock().inputTank, () -> tile.getMultiblock().getFluidTanks(null), GaugeType.STANDARD, this, 6, 13));
    addButton(new GuiFluidGauge(() -> tile.getMultiblock().outputTank, () -> tile.getMultiblock().getFluidTanks(null), GaugeType.STANDARD, this, 152, 13));
    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) GuiDownArrow(mekanism.client.gui.element.GuiDownArrow) IBarInfoHandler(mekanism.client.gui.element.bar.GuiBar.IBarInfoHandler) GuiHorizontalRateBar(mekanism.client.gui.element.bar.GuiHorizontalRateBar) ITextComponent(net.minecraft.util.text.ITextComponent) EvaporationMultiblockData(mekanism.common.content.evaporation.EvaporationMultiblockData) GuiHeatTab(mekanism.client.gui.element.tab.GuiHeatTab)

Example 2 with EvaporationMultiblockData

use of mekanism.common.content.evaporation.EvaporationMultiblockData in project Mekanism by mekanism.

the class RenderThermalEvaporationPlant method render.

@Override
protected void render(TileEntityThermalEvaporationController tile, float partialTick, MatrixStack matrix, IRenderTypeBuffer renderer, int light, int overlayLight, IProfiler profiler) {
    if (tile.isMaster()) {
        EvaporationMultiblockData multiblock = tile.getMultiblock();
        if (multiblock.isFormed() && multiblock.renderLocation != null && !multiblock.inputTank.isEmpty()) {
            FluidRenderData data = new FluidRenderData(multiblock.inputTank.getFluid());
            data.location = multiblock.renderLocation.offset(1, 0, 1);
            data.height = multiblock.height() - 2;
            data.length = 2;
            data.width = 2;
            matrix.pushPose();
            BlockPos pos = tile.getBlockPos();
            int glow = data.calculateGlowLight(MekanismRenderer.FULL_SKY_LIGHT);
            matrix.translate(data.location.getX() - pos.getX(), data.location.getY() - pos.getY(), data.location.getZ() - pos.getZ());
            IVertexBuilder buffer = renderer.getBuffer(Atlases.translucentCullBlockSheet());
            Model3D model = ModelRenderer.getModel(data, Math.min(1, multiblock.prevScale));
            MekanismRenderer.renderObject(model, matrix, buffer, data.getColorARGB(multiblock.prevScale), glow, overlayLight, getFaceDisplay(data, model));
            matrix.popPose();
            MekanismRenderer.renderValves(matrix, buffer, multiblock.valves, data, pos, glow, overlayLight, isInsideMultiblock(data));
        }
    }
}
Also used : Model3D(mekanism.client.render.MekanismRenderer.Model3D) FluidRenderData(mekanism.client.render.data.FluidRenderData) BlockPos(net.minecraft.util.math.BlockPos) EvaporationMultiblockData(mekanism.common.content.evaporation.EvaporationMultiblockData) IVertexBuilder(com.mojang.blaze3d.vertex.IVertexBuilder)

Aggregations

EvaporationMultiblockData (mekanism.common.content.evaporation.EvaporationMultiblockData)2 IVertexBuilder (com.mojang.blaze3d.vertex.IVertexBuilder)1 GuiDownArrow (mekanism.client.gui.element.GuiDownArrow)1 GuiInnerScreen (mekanism.client.gui.element.GuiInnerScreen)1 IBarInfoHandler (mekanism.client.gui.element.bar.GuiBar.IBarInfoHandler)1 GuiHorizontalRateBar (mekanism.client.gui.element.bar.GuiHorizontalRateBar)1 GuiFluidGauge (mekanism.client.gui.element.gauge.GuiFluidGauge)1 GuiHeatTab (mekanism.client.gui.element.tab.GuiHeatTab)1 Model3D (mekanism.client.render.MekanismRenderer.Model3D)1 FluidRenderData (mekanism.client.render.data.FluidRenderData)1 BlockPos (net.minecraft.util.math.BlockPos)1 ITextComponent (net.minecraft.util.text.ITextComponent)1