use of crazypants.enderio.powertools.machine.capbank.TileCapBank in project EnderIO by SleepyTrousers.
the class CapBankNetwork method setMaxOutput.
@Override
public void setMaxOutput(int max) {
if (DiagnosticsConfig.debugTraceCapLimitsExtremelyDetailed.get()) {
StringBuilder sb = new StringBuilder("CapBankNetwork ").append(this).append(" output changed from ").append(this.maxOutput).append(" to ").append(max);
for (StackTraceElement elem : new Exception("Stackstrace").getStackTrace()) {
sb.append(" at ").append(elem);
}
Log.warn(sb);
}
if (max >= maxIO) {
maxOutput = -1;
} else if (max < 0) {
maxOutput = 0;
} else {
maxOutput = max;
}
for (TileCapBank cb : capBanks) {
cb.setMaxOutput(maxOutput);
}
}
use of crazypants.enderio.powertools.machine.capbank.TileCapBank in project EnderIO by SleepyTrousers.
the class CapBankNetwork method distributeEnergyToBanks.
private void distributeEnergyToBanks() {
if (capBanks.isEmpty()) {
return;
}
int energyPerCapBank = (int) (energyStored / capBanks.size());
int remaining = (int) (energyStored % capBanks.size());
for (TileCapBank cb : capBanks) {
cb.setEnergyStored(energyPerCapBank);
}
TileCapBank cb = capBanks.get(0);
cb.setEnergyStored(cb.getEnergyStored() + remaining);
}
use of crazypants.enderio.powertools.machine.capbank.TileCapBank in project EnderIO by SleepyTrousers.
the class CapBankNetwork method init.
// --------- Network Management
public void init(TileCapBank cap, Collection<TileCapBank> neighbours, World world) {
if (world.isRemote) {
throw new UnsupportedOperationException();
}
type = cap.getType();
inputControlMode = cap.getInputControlMode();
outputControlMode = cap.getOutputControlMode();
for (TileCapBank con : neighbours) {
ICapBankNetwork network = con.getNetwork();
if (network != null) {
network.destroyNetwork();
}
}
setNetwork(world, cap);
// ensure energy level is within bounds
addEnergy(0);
ServerTickHandler.addListener(this);
}
use of crazypants.enderio.powertools.machine.capbank.TileCapBank in project EnderIO by SleepyTrousers.
the class CapBankNetwork method setInputControlMode.
@Override
public void setInputControlMode(@Nonnull RedstoneControlMode inputControlMode) {
if (this.inputControlMode == inputControlMode) {
return;
}
this.inputControlMode = inputControlMode;
for (TileCapBank capBank : capBanks) {
capBank.setInputControlMode(inputControlMode);
}
updateRedstoneConditions();
}
use of crazypants.enderio.powertools.machine.capbank.TileCapBank in project EnderIO by SleepyTrousers.
the class CapBankNetwork method setOutputControlMode.
@Override
public void setOutputControlMode(@Nonnull RedstoneControlMode outputControlMode) {
if (this.outputControlMode == outputControlMode) {
return;
}
this.outputControlMode = outputControlMode;
for (TileCapBank capBank : capBanks) {
capBank.setOutputControlMode(outputControlMode);
}
updateRedstoneConditions();
}
Aggregations