Speed up items charge.
This commit is contained in:
parent
af6cb38bfb
commit
00a317074d
2 changed files with 2 additions and 2 deletions
|
@ -72,7 +72,7 @@ public class TileChargeOMat extends TilePowerAcceptor
|
|||
final ItemStack stack = inventory.getStackInSlot(i);
|
||||
if (stack.hasCapability(CapabilityEnergy.ENERGY, null)) {
|
||||
IEnergyStorage powerItem = stack.getCapability(CapabilityEnergy.ENERGY, null);
|
||||
int maxReceive = powerItem.receiveEnergy((int)getMaxOutput(), true);
|
||||
int maxReceive = powerItem.receiveEnergy((int)getMaxInput() * RebornCoreConfig.euPerFU, true);
|
||||
double maxUse = Math.min((double) (maxReceive / RebornCoreConfig.euPerFU), getMaxInput());
|
||||
if (getEnergy() >= 0.0 && maxReceive > 0) {
|
||||
powerItem.receiveEnergy((int) useEnergy(maxUse) * RebornCoreConfig.euPerFU, false);
|
||||
|
|
|
@ -73,7 +73,7 @@ public class TileEnergyStorage extends TilePowerAcceptor
|
|||
ItemStack stack = inventory.getStackInSlot(0);
|
||||
if (stack.hasCapability(CapabilityEnergy.ENERGY, null)) {
|
||||
IEnergyStorage powerItem = stack.getCapability(CapabilityEnergy.ENERGY, null);
|
||||
int maxReceive = powerItem.receiveEnergy((int)getMaxOutput(), true);
|
||||
int maxReceive = powerItem.receiveEnergy((int)getMaxOutput() * RebornCoreConfig.euPerFU, true);
|
||||
double maxUse = Math.min((double) (maxReceive / RebornCoreConfig.euPerFU), getMaxOutput());
|
||||
if (getEnergy() >= 0.0 && maxReceive > 0) {
|
||||
powerItem.receiveEnergy((int) useEnergy(maxUse) * RebornCoreConfig.euPerFU, false);
|
||||
|
|
Loading…
Reference in a new issue