mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-26 15:03:07 +00:00
#601 Capacitor bank overcharges with BC kinetic pipes
This commit is contained in:
1 parent
c05611c61f
commit
3cd991ccf4
1 file changed
+9
-2
@@ -64,6 +64,8 @@ public class TileCapacitorBank extends TileEntity implements IInternalPowerRecep
|
||||
|
||||
private int maxOutput;
|
||||
|
||||
private int mjBuf = 0;
|
||||
|
||||
private boolean multiblockDirty = false;
|
||||
|
||||
private RedstoneControlMode inputControlMode;
|
||||
@@ -602,9 +604,14 @@ public class TileCapacitorBank extends TileEntity implements IInternalPowerRecep
|
||||
|
||||
PowerHandler doGetPowerHandler() {
|
||||
if(inputEnabled) {
|
||||
if(powerHandler == null) {
|
||||
powerHandler = PowerHandlerUtil.createHandler(new BasicCapacitor(maxInput, maxInput, maxOutput), this, Type.STORAGE);
|
||||
float space = getMaxEnergyStored() - getEnergyStored();
|
||||
int canAccept = (int) Math.min(space, maxInput);
|
||||
|
||||
if(powerHandler == null || canAccept != mjBuf) {
|
||||
mjBuf = canAccept;
|
||||
powerHandler = PowerHandlerUtil.createHandler(new BasicCapacitor(maxInput, mjBuf, maxOutput), this, Type.STORAGE);
|
||||
}
|
||||
|
||||
return powerHandler;
|
||||
}
|
||||
return getDisabledPowerHandler();
|
||||
|
||||
Reference in new issue
Block a user