Merge branch 'development' into 1.8

Conflicts:
	src/main/java/mekanism/common/util/MekanismUtils.java
This commit is contained in:
Ben Spiers 2014-09-01 04:10:53 +01:00
commit 0be5320143
3 changed files with 12 additions and 11 deletions

View file

@ -267,11 +267,14 @@ public class FluidNetwork extends DynamicNetwork<IFluidHandler, FluidNetwork>
if(fluidStored != null) if(fluidStored != null)
{ {
prevTransferAmount = tickEmit(fluidStored, true); prevTransferAmount = tickEmit(fluidStored, true);
fluidStored.amount -= prevTransferAmount; if(fluidStored != null)
if(fluidStored != null && fluidStored.amount <= 0)
{ {
fluidStored = null; fluidStored.amount -= prevTransferAmount;
if(fluidStored.amount <= 0)
{
fluidStored = null;
}
} }
} }
} }

View file

@ -237,17 +237,15 @@ public final class CableUtils
{ {
double sent = 0; double sent = 0;
boolean tryAgain = false; boolean tryAgain = false;
int i = 0;
do { do {
tryAgain = false;
double prev = sent; double prev = sent;
sent += emit_do(emitter, outputtingSides, energyToSend-sent, tryAgain); sent += emit_do(emitter, outputtingSides, energyToSend-sent, tryAgain);
if(energyToSend-sent > 0 && sent-prev > 0) tryAgain = energyToSend-sent > 0 && sent-prev > 0 && i < 100;
{
tryAgain = true; i++;
}
} while(tryAgain); } while(tryAgain);
emitter.setEnergy(emitter.getEnergy() - sent); emitter.setEnergy(emitter.getEnergy() - sent);

View file

@ -634,7 +634,7 @@ public final class MekanismUtils
*/ */
public static int getSecondaryEnergyPerTick(IUpgradeTile mgmt, int def) public static int getSecondaryEnergyPerTick(IUpgradeTile mgmt, int def)
{ {
return def * (int)Math.pow(general.maxUpgradeMultiplier, mgmt.getComponent().getUpgrades(Upgrade.SPEED)/(float)Upgrade.SPEED.getMax()); return (int)(def * Math.pow(general.maxUpgradeMultiplier, mgmt.getComponent().getUpgrades(Upgrade.SPEED)/(float)Upgrade.SPEED.getMax()));
} }
/** /**