fix #3234
This commit is contained in:
parent
0de4f15598
commit
dadcd12874
1 changed files with 2 additions and 2 deletions
|
@ -186,7 +186,7 @@ public abstract class TileBuildCraft extends TileEntity implements IEnergyHandle
|
|||
public int receiveEnergy(ForgeDirection from, int maxReceive,
|
||||
boolean simulate) {
|
||||
if (battery != null && this.canConnectEnergy(from)) {
|
||||
int received = battery.receiveEnergy(maxReceive - receivedTick, simulate);
|
||||
int received = battery.receiveEnergy(Math.min(maxReceive, battery.getMaxEnergyReceive() - receivedTick), simulate);
|
||||
if (!simulate) {
|
||||
receivedTick += received;
|
||||
worldTimeEnergyReceive = worldObj.getTotalWorldTime();
|
||||
|
@ -203,7 +203,7 @@ public abstract class TileBuildCraft extends TileEntity implements IEnergyHandle
|
|||
public int extractEnergy(ForgeDirection from, int maxExtract,
|
||||
boolean simulate) {
|
||||
if (battery != null && this.canConnectEnergy(from)) {
|
||||
int extracted = battery.extractEnergy(maxExtract - extractedTick, simulate);
|
||||
int extracted = battery.extractEnergy(Math.min(maxExtract, battery.getMaxEnergyExtract() - extractedTick), simulate);
|
||||
if (!simulate) {
|
||||
extractedTick += extracted;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue