From 12e4b947143d459fb66790d68d8b042170f10808 Mon Sep 17 00:00:00 2001 From: Andrew Hill Date: Tue, 4 Sep 2012 19:31:52 +1000 Subject: [PATCH] Quary should not use energy when 0 movement would result Position is stored in 1/32's so if the movement is less than that, it will take the energy, then not move at all. This means that energy less than about 3.2/tick will never move the quary arm. --- common/buildcraft/factory/TileQuarry.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/common/buildcraft/factory/TileQuarry.java b/common/buildcraft/factory/TileQuarry.java index c3f09a4e..0fe16814 100644 --- a/common/buildcraft/factory/TileQuarry.java +++ b/common/buildcraft/factory/TileQuarry.java @@ -134,10 +134,13 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine, I arm.setArmSpeed(0); 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) { - arm.doMove(0.015 + energy / 200F); + if (energy > 0) { + arm.doMove(0.015 + energy / 200F); + } } }