use of mekanism.common.integration.computer.annotation.ComputerMethod in project Mekanism by mekanism.
the class TileEntitySawingFactory method getSecondaryOutput.
// Methods relating to IComputerTile
@ComputerMethod
private ItemStack getSecondaryOutput(int process) throws ComputerException {
validateValidProcess(process);
IInventorySlot secondaryOutputSlot = processInfoSlots[process].getSecondaryOutputSlot();
// This should never be null, but in case it is, handle it
return secondaryOutputSlot == null ? ItemStack.EMPTY : secondaryOutputSlot.getStack();
}
use of mekanism.common.integration.computer.annotation.ComputerMethod in project Mekanism by mekanism.
the class TileEntityTeleporter method incrementFrequencyColor.
@ComputerMethod
private void incrementFrequencyColor() throws ComputerException {
validateSecurityIsPublic();
TeleporterFrequency frequency = getFrequency();
frequency.setColor(frequency.getColor().getNext());
}
use of mekanism.common.integration.computer.annotation.ComputerMethod in project Mekanism by mekanism.
the class TileEntityTeleporter method setFrequency.
@ComputerMethod
private void setFrequency(String name) throws ComputerException {
validateSecurityIsPublic();
TeleporterFrequency frequency = FrequencyType.TELEPORTER.getManagerWrapper().getPublicManager().getFrequency(name);
if (frequency == null) {
throw new ComputerException("No public teleporter frequency with name '%s' found.", name);
}
setFrequency(FrequencyType.TELEPORTER, frequency.getIdentity(), getOwnerUUID());
}
use of mekanism.common.integration.computer.annotation.ComputerMethod in project Mekanism by mekanism.
the class TileEntityMekanism method getTotalEnergyFilledPercentage.
@ComputerMethod(nameOverride = "getEnergyFilledPercentage", restriction = MethodRestriction.ENERGY)
private double getTotalEnergyFilledPercentage() {
FloatingLong stored = FloatingLong.ZERO;
FloatingLong max = FloatingLong.ZERO;
List<IEnergyContainer> energyContainers = getEnergyContainers(null);
for (IEnergyContainer energyContainer : energyContainers) {
stored = stored.plusEqual(energyContainer.getEnergy());
max = max.plusEqual(energyContainer.getMaxEnergy());
}
return stored.divideToLevel(max);
}
use of mekanism.common.integration.computer.annotation.ComputerMethod 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());
}
Aggregations