Merge branch 'development' of https://github.com/aidancbrady/Mekanism into development

This commit is contained in:
Aidan C. Brady committed 2013-12-16 11:16:17 -05:00
commit 00b666a779
5 files changed
+8 -5

No files matched your search

+1 -1
View File
@@ -295,7 +295,7 @@ public class GasNetwork extends DynamicNetwork<IGasHandler, GasNetwork>
public float getScale()
{
return (gasStored != null ? gasStored.amount : 0)/getCapacity();
return (gasStored == null || getCapacity() == 0 ? 0 : gasStored.amount/getCapacity());
}
@Override
@@ -113,7 +113,7 @@ public abstract class DynamicNetwork<A, N extends DynamicNetwork<A, N>> implemen
*/
public double getMeanCapacity()
{
return transmitters.iterator().next().getCapacity();
return transmitters.size() > 0 ? transmitters.iterator().next().getCapacity() : 0;
}
@Override
+1 -1
View File
@@ -405,7 +405,7 @@ public class EnergyNetwork extends DynamicNetwork<TileEntity, EnergyNetwork>
public double getPowerScale()
{
return Math.max(joulesLastTick == 0 ? 0 : Math.min(Math.ceil(Math.log10(getPower())*2)/10, 1), electricityStored/getCapacity());
return Math.max(joulesLastTick == 0 ? 0 : Math.min(Math.ceil(Math.log10(getPower())*2)/10, 1), getCapacity() == 0 ? 0 : electricityStored/getCapacity());
}
public void clearJoulesTransmitted()
+2 -2
View File
@@ -303,7 +303,7 @@ public class FluidNetwork extends DynamicNetwork<IFluidHandler, FluidNetwork>
public float getScale()
{
return (fluidStored != null ? fluidStored.amount : 0)/getCapacity();
return (fluidStored == null || getCapacity() == 0 ? 0 : fluidStored.amount/getCapacity());
}
@Override
@@ -359,6 +359,6 @@ public class FluidNetwork extends DynamicNetwork<IFluidHandler, FluidNetwork>
@Override
public String getFlow()
{
return fluidStored + " mB";
return fluidStored == null ? "None" : fluidStored.getFluid().getLocalizedName() + ", " + fluidStored.amount + "mB/tick";
}
}
@@ -253,6 +253,9 @@ public abstract class PartTransmitter<N extends DynamicNetwork<?, N>> extends Pa
super.preRemove();
}
@Override
public void chunkLoad() {}
@Override
public void onAdded()