Search in sources :

Example 1 with InventoryFrequency

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));
    }));
}
Also used : EnergyDisplay(mekanism.common.util.text.EnergyDisplay) ITextComponent(net.minecraft.util.text.ITextComponent) InventoryFrequency(mekanism.common.content.entangloporter.InventoryFrequency) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab) GuiHeatTab(mekanism.client.gui.element.tab.GuiHeatTab)

Example 2 with InventoryFrequency

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());
}
Also used : FrequencyIdentity(mekanism.common.lib.frequency.Frequency.FrequencyIdentity) InventoryFrequency(mekanism.common.content.entangloporter.InventoryFrequency) ComputerException(mekanism.common.integration.computer.ComputerException) WrappingComputerMethod(mekanism.common.integration.computer.annotation.WrappingComputerMethod) ComputerMethod(mekanism.common.integration.computer.annotation.ComputerMethod)

Example 3 with InventoryFrequency

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());
}
Also used : InventoryFrequency(mekanism.common.content.entangloporter.InventoryFrequency) ComputerException(mekanism.common.integration.computer.ComputerException) WrappingComputerMethod(mekanism.common.integration.computer.annotation.WrappingComputerMethod) ComputerMethod(mekanism.common.integration.computer.annotation.ComputerMethod)

Aggregations

InventoryFrequency (mekanism.common.content.entangloporter.InventoryFrequency)3 ComputerException (mekanism.common.integration.computer.ComputerException)2 ComputerMethod (mekanism.common.integration.computer.annotation.ComputerMethod)2 WrappingComputerMethod (mekanism.common.integration.computer.annotation.WrappingComputerMethod)2 GuiEnergyTab (mekanism.client.gui.element.tab.GuiEnergyTab)1 GuiHeatTab (mekanism.client.gui.element.tab.GuiHeatTab)1 FrequencyIdentity (mekanism.common.lib.frequency.Frequency.FrequencyIdentity)1 EnergyDisplay (mekanism.common.util.text.EnergyDisplay)1 ITextComponent (net.minecraft.util.text.ITextComponent)1