Search in sources :

Example 6 with ComputerMethod

use of mekanism.common.integration.computer.annotation.ComputerMethod 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)

Example 7 with ComputerMethod

use of mekanism.common.integration.computer.annotation.ComputerMethod in project Mekanism by mekanism.

the class TileComponentConfig method incrementMode.

@ComputerMethod
private void incrementMode(TransmissionType type, RelativeSide side) throws ComputerException {
    tile.validateSecurityIsPublic();
    validateSupportedTransmissionType(type);
    ConfigInfo configInfo = this.configInfo.get(type);
    if (configInfo.getDataType(side) != configInfo.incrementDataType(side)) {
        sideChanged(type, side);
    }
}
Also used : ConfigInfo(mekanism.common.tile.component.config.ConfigInfo) ComputerMethod(mekanism.common.integration.computer.annotation.ComputerMethod)

Example 8 with ComputerMethod

use of mekanism.common.integration.computer.annotation.ComputerMethod in project Mekanism by mekanism.

the class TileComponentConfig method decrementMode.

@ComputerMethod
private void decrementMode(TransmissionType type, RelativeSide side) throws ComputerException {
    tile.validateSecurityIsPublic();
    validateSupportedTransmissionType(type);
    ConfigInfo configInfo = this.configInfo.get(type);
    if (configInfo.getDataType(side) != configInfo.decrementDataType(side)) {
        sideChanged(type, side);
    }
}
Also used : ConfigInfo(mekanism.common.tile.component.config.ConfigInfo) ComputerMethod(mekanism.common.integration.computer.annotation.ComputerMethod)

Example 9 with ComputerMethod

use of mekanism.common.integration.computer.annotation.ComputerMethod in project Mekanism by mekanism.

the class TileEntityQIOComponent method decrementFrequencyColor.

@ComputerMethod
private void decrementFrequencyColor() throws ComputerException {
    validateSecurityIsPublic();
    QIOFrequency frequency = computerGetFrequency();
    frequency.setColor(frequency.getColor().getPrevious());
}
Also used : QIOFrequency(mekanism.common.content.qio.QIOFrequency) ComputerMethod(mekanism.common.integration.computer.annotation.ComputerMethod)

Example 10 with ComputerMethod

use of mekanism.common.integration.computer.annotation.ComputerMethod in project Mekanism by mekanism.

the class TileEntityDiversionTransporter method incrementMode.

@ComputerMethod
private void incrementMode(Direction side) {
    DiversionTransporter transmitter = getTransmitter();
    transmitter.updateMode(side, transmitter.modes[side.ordinal()].getNext());
}
Also used : DiversionTransporter(mekanism.common.content.network.transmitter.DiversionTransporter) ComputerMethod(mekanism.common.integration.computer.annotation.ComputerMethod)

Aggregations

ComputerMethod (mekanism.common.integration.computer.annotation.ComputerMethod)23 ComputerException (mekanism.common.integration.computer.ComputerException)10 WrappingComputerMethod (mekanism.common.integration.computer.annotation.WrappingComputerMethod)9 QIOFrequency (mekanism.common.content.qio.QIOFrequency)4 TeleporterFrequency (mekanism.common.content.teleporter.TeleporterFrequency)4 ConfigInfo (mekanism.common.tile.component.config.ConfigInfo)4 SyntheticComputerMethod (mekanism.common.integration.computer.annotation.SyntheticComputerMethod)3 FrequencyIdentity (mekanism.common.lib.frequency.Frequency.FrequencyIdentity)3 Nonnull (javax.annotation.Nonnull)2 FloatingLong (mekanism.api.math.FloatingLong)2 InventoryFrequency (mekanism.common.content.entangloporter.InventoryFrequency)2 DiversionTransporter (mekanism.common.content.network.transmitter.DiversionTransporter)2 BoundComputerMethod (mekanism.common.integration.computer.BoundComputerMethod)2 SyncableItemStack (mekanism.common.inventory.container.sync.SyncableItemStack)2 ItemStack (net.minecraft.item.ItemStack)2 Object2ObjectOpenHashMap (it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap)1 ElementType (java.lang.annotation.ElementType)1 MethodHandle (java.lang.invoke.MethodHandle)1 MethodHandles (java.lang.invoke.MethodHandles)1 Field (java.lang.reflect.Field)1