use of mekanism.common.content.entangloporter.InventoryFrequency 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.content.entangloporter.InventoryFrequency in project Mekanism by mekanism.
the class TileEntityQuantumEntangloporter method createFrequency.
@ComputerMethod
private void createFrequency(String name) throws ComputerException {
validateSecurityIsPublic();
InventoryFrequency frequency = FrequencyType.INVENTORY.getManagerWrapper().getPublicManager().getFrequency(name);
if (frequency != null) {
throw new ComputerException("Unable to create public inventory frequency with name '%s' as one already exists.", name);
}
setFrequency(FrequencyType.INVENTORY, new FrequencyIdentity(name, true), getOwnerUUID());
}
use of mekanism.common.content.entangloporter.InventoryFrequency in project Mekanism by mekanism.
the class TileEntityQuantumEntangloporter method setFrequency.
@ComputerMethod
private void setFrequency(String name) throws ComputerException {
validateSecurityIsPublic();
InventoryFrequency frequency = FrequencyType.INVENTORY.getManagerWrapper().getPublicManager().getFrequency(name);
if (frequency == null) {
throw new ComputerException("No public inventory frequency with name '%s' found.", name);
}
setFrequency(FrequencyType.INVENTORY, frequency.getIdentity(), getOwnerUUID());
}
Aggregations