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);
}
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);
}
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));
}));
}
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();
}
}
}
}
}
Aggregations