Merge pull request #210 from AartBluestoke/patch-11
Quary should not use energy when 0 movement would result
This commit is contained in:
commit
e1c8d447cc
1 changed files with 6 additions and 3 deletions
|
@ -134,10 +134,13 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, I
|
||||||
arm.setArmSpeed(0);
|
arm.setArmSpeed(0);
|
||||||
float energyToUse = 2 + powerProvider.getEnergyStored() / 1000;
|
float energyToUse = 2 + powerProvider.getEnergyStored() / 1000;
|
||||||
|
|
||||||
float energy = powerProvider.useEnergy(energyToUse, energyToUse, true);
|
boolean enoughStep=(0.015 + energyToUse / 200F)>(1F/32F); // (otherwise the movement is rounded to 0 and the energy absorbed with no movement)
|
||||||
|
if(enoughStep){
|
||||||
|
float energy = powerProvider.useEnergy(energyToUse, energyToUse, true);
|
||||||
|
|
||||||
if (energy > 0) {
|
if (energy > 0) {
|
||||||
arm.doMove(0.015 + energy / 200F);
|
arm.doMove(0.015 + energy / 200F);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue