mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-26 06:53:24 +00:00
#601 Capacitor bank overcharges with BC kinetic pipes
This commit is contained in:
1 parent
3b5a92a159
commit
34dbc4046e
2 files changed
+10
-2
No files matched your search
@@ -58,6 +58,8 @@ public class TileCapacitorBank extends TileEntityEio implements IInternalPowerRe
|
||||
|
||||
private int maxOutput;
|
||||
|
||||
private int mjBuf = 0;
|
||||
|
||||
private boolean multiblockDirty = false;
|
||||
|
||||
private RedstoneControlMode inputControlMode;
|
||||
@@ -636,8 +638,11 @@ public class TileCapacitorBank extends TileEntityEio implements IInternalPowerRe
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user