use of mekanism.common.integration.computer.annotation.ComputerMethod in project Mekanism by mekanism.
the class TileEntityQIOComponent method createFrequency.
@ComputerMethod
private void createFrequency(String name) throws ComputerException {
validateSecurityIsPublic();
QIOFrequency frequency = FrequencyType.QIO.getManagerWrapper().getPublicManager().getFrequency(name);
if (frequency != null) {
throw new ComputerException("Unable to create public QIO frequency with name '%s' as one already exists.", name);
}
setFrequency(FrequencyType.QIO, new FrequencyIdentity(name, true), getOwnerUUID());
}
use of mekanism.common.integration.computer.annotation.ComputerMethod in project Mekanism by mekanism.
the class TurbineMultiblockData method getMaxProduction.
@ComputerMethod
public FloatingLong getMaxProduction() {
FloatingLong energyMultiplier = MekanismConfig.general.maxEnergyPerSteam.get().divide(TurbineValidator.MAX_BLADES).multiply(Math.min(blades, coils * MekanismGeneratorsConfig.generators.turbineBladesPerCoil.get()));
double rate = lowerVolume * (getDispersers() * MekanismGeneratorsConfig.generators.turbineDisperserGasFlow.get());
rate = Math.min(rate, vents * MekanismGeneratorsConfig.generators.turbineVentGasFlow.get());
return energyMultiplier.multiply(rate);
}
use of mekanism.common.integration.computer.annotation.ComputerMethod in project Mekanism by mekanism.
the class TileEntityTeleporter method decrementFrequencyColor.
@ComputerMethod
private void decrementFrequencyColor() throws ComputerException {
validateSecurityIsPublic();
TeleporterFrequency frequency = getFrequency();
frequency.setColor(frequency.getColor().getPrevious());
}
use of mekanism.common.integration.computer.annotation.ComputerMethod in project Mekanism by mekanism.
the class TileComponentConfig method setMode.
@ComputerMethod
private void setMode(TransmissionType type, RelativeSide side, DataType mode) throws ComputerException {
tile.validateSecurityIsPublic();
validateSupportedTransmissionType(type);
ConfigInfo config = configInfo.get(type);
if (!config.getSupportedDataTypes().contains(mode)) {
throw new ComputerException("This machine does not support mode '%s' for transmission type '%s'.", mode, type);
}
DataType currentMode = config.getDataType(side);
if (mode != currentMode) {
config.setDataType(mode, side);
sideChanged(type, side);
}
}
use of mekanism.common.integration.computer.annotation.ComputerMethod in project Mekanism by mekanism.
the class TileEntityTeleporter method createFrequency.
@ComputerMethod
private void createFrequency(String name) throws ComputerException {
validateSecurityIsPublic();
TeleporterFrequency frequency = FrequencyType.TELEPORTER.getManagerWrapper().getPublicManager().getFrequency(name);
if (frequency != null) {
throw new ComputerException("Unable to create public teleporter frequency with name '%s' as one already exists.", name);
}
setFrequency(FrequencyType.TELEPORTER, new FrequencyIdentity(name, true), getOwnerUUID());
}
Aggregations