use of mekanism.common.util.text.EnergyDisplay in project Mekanism by mekanism.
the class GuiQuantumEntangloporter method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiFrequencySelector<>(this, 14));
addButton(new GuiEnergyTab(this, () -> {
InventoryFrequency frequency = getFrequency();
EnergyDisplay storing = frequency == null ? EnergyDisplay.ZERO : EnergyDisplay.of(frequency.storedEnergy);
EnergyDisplay rate = EnergyDisplay.of(tile.getInputRate());
return Arrays.asList(MekanismLang.STORING.translate(storing), MekanismLang.MATRIX_INPUT_RATE.translate(rate));
}));
addButton(new GuiHeatTab(this, () -> {
ITextComponent transfer = MekanismUtils.getTemperatureDisplay(tile.getLastTransferLoss(), TemperatureUnit.KELVIN, false);
ITextComponent environment = MekanismUtils.getTemperatureDisplay(tile.getLastEnvironmentLoss(), TemperatureUnit.KELVIN, false);
return Arrays.asList(MekanismLang.TRANSFERRED_RATE.translate(transfer), MekanismLang.DISSIPATED_RATE.translate(environment));
}));
}
use of mekanism.common.util.text.EnergyDisplay in project Mekanism by mekanism.
the class GuiIndustrialTurbine method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiInnerScreen(this, 50, 18, 112, 50, () -> {
List<ITextComponent> list = new ArrayList<>();
TurbineMultiblockData multiblock = tile.getMultiblock();
if (multiblock.isFormed()) {
list.add(GeneratorsLang.TURBINE_PRODUCTION_AMOUNT.translate(EnergyDisplay.of(multiblock.getProductionRate())));
list.add(GeneratorsLang.TURBINE_FLOW_RATE.translate(TextUtils.format(multiblock.clientFlow)));
list.add(GeneratorsLang.TURBINE_CAPACITY.translate(TextUtils.format(multiblock.getSteamCapacity())));
list.add(GeneratorsLang.TURBINE_MAX_FLOW.translate(TextUtils.format(multiblock.getMaxFlowRate())));
}
return list;
}));
addButton(new GuiTurbineTab(this, tile, TurbineTab.STAT));
addButton(new GuiVerticalPowerBar(this, new IBarInfoHandler() {
@Override
public ITextComponent getTooltip() {
TurbineMultiblockData multiblock = tile.getMultiblock();
if (multiblock.isFormed()) {
return EnergyDisplay.of(multiblock.energyContainer).getTextComponent();
}
return EnergyDisplay.ZERO.getTextComponent();
}
@Override
public double getLevel() {
TurbineMultiblockData multiblock = tile.getMultiblock();
if (multiblock.isFormed()) {
return multiblock.energyContainer.getEnergy().divideToLevel(multiblock.energyContainer.getMaxEnergy());
}
return 1;
}
}, 164, 16));
addButton(new GuiVerticalRateBar(this, new IBarInfoHandler() {
@Override
public ITextComponent getTooltip() {
return GeneratorsLang.TURBINE_STEAM_INPUT_RATE.translate(TextUtils.format(tile.getMultiblock().lastSteamInput));
}
@Override
public double getLevel() {
TurbineMultiblockData multiblock = tile.getMultiblock();
if (!multiblock.isFormed()) {
return 0;
}
double rate = Math.min(multiblock.lowerVolume * multiblock.getDispersers() * MekanismGeneratorsConfig.generators.turbineDisperserGasFlow.get(), multiblock.vents * MekanismGeneratorsConfig.generators.turbineVentGasFlow.get());
if (rate == 0) {
return 0;
}
return Math.min(1, multiblock.lastSteamInput / rate);
}
}, 40, 13));
addButton(new GuiGasGauge(() -> tile.getMultiblock().gasTank, () -> tile.getMultiblock().getGasTanks(null), GaugeType.MEDIUM, this, 6, 13));
addButton(new GuiEnergyTab(this, () -> {
EnergyDisplay storing;
EnergyDisplay producing;
TurbineMultiblockData multiblock = tile.getMultiblock();
if (multiblock.isFormed()) {
storing = EnergyDisplay.of(multiblock.energyContainer);
producing = EnergyDisplay.of(MekanismConfig.general.maxEnergyPerSteam.get().divide(TurbineValidator.MAX_BLADES).multiply(multiblock.clientFlow * Math.min(multiblock.blades, multiblock.coils * MekanismGeneratorsConfig.generators.turbineBladesPerCoil.get())));
} else {
storing = EnergyDisplay.ZERO;
producing = EnergyDisplay.ZERO;
}
return Arrays.asList(MekanismLang.STORING.translate(storing), GeneratorsLang.PRODUCING_AMOUNT.translate(producing));
}));
addButton(new GuiGasMode(this, 159, 72, true, () -> tile.getMultiblock().dumpMode, tile.getBlockPos(), 0));
}
use of mekanism.common.util.text.EnergyDisplay in project Mekanism by mekanism.
the class GuiTurbineStats method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiTurbineTab(this, tile, TurbineTab.MAIN));
addButton(new GuiEnergyTab(this, () -> {
EnergyDisplay storing;
EnergyDisplay producing;
TurbineMultiblockData multiblock = tile.getMultiblock();
if (multiblock.isFormed()) {
storing = EnergyDisplay.of(multiblock.energyContainer);
producing = EnergyDisplay.of(MekanismConfig.general.maxEnergyPerSteam.get().divide(TurbineValidator.MAX_BLADES).multiply(multiblock.clientFlow * Math.min(multiblock.blades, multiblock.coils * MekanismGeneratorsConfig.generators.turbineBladesPerCoil.get())));
} else {
storing = EnergyDisplay.ZERO;
producing = EnergyDisplay.ZERO;
}
return Arrays.asList(MekanismLang.STORING.translate(storing), GeneratorsLang.PRODUCING_AMOUNT.translate(producing));
}));
}
Aggregations