Fix #925 Fermenter null fluid crash

This commit is contained in:
mezz committed 2015-10-26 22:48:15 -07:00
1 parent 8502ec84f9
commit 45f844b53b
4 files changed
+11 -5

No files matched your search

@@ -351,6 +351,13 @@ public class TankManager implements ITankManager {
return drained;
}
public FluidStack drain(Fluid resource, int amount, boolean doDrain) {
if (resource == null) {
return null;
}
return drain(new FluidStack(resource, amount), false, doDrain);
}
public FluidStack drain(FluidStack resource, boolean doDrain) {
return drain(resource, false, doDrain);
}
@@ -153,7 +153,7 @@ public class TileFabricator extends TilePowered implements ICrafter, ILiquidTank
if (!moltenTank.isEmpty()) {
// Remove smelt if we have gone below melting point
if (heat < (getMeltingPoint() - 100)) {
tankManager.drain(new FluidStack(moltenTank.getFluidType(), 5), true);
tankManager.drain(moltenTank.getFluidType(), 5, true);
}
}
@@ -201,8 +201,7 @@ public class TileFermenter extends TilePowered implements ISidedInventory, ILiqu
}
fuelBurnTime--;
FluidStack drainResource = new FluidStack(resourceTank.getFluidType(), fuelCurrentFerment);
tankManager.drain(drainResource, true);
tankManager.drain(resourceTank.getFluidType(), fuelCurrentFerment, true);
fermentationTime -= this.fuelCurrentFerment;
// Not done yet
@@ -416,7 +415,7 @@ public class TileFermenter extends TilePowered implements ISidedInventory, ILiqu
@Override
public FluidStack drain(ForgeDirection from, int quantityMax, boolean doEmpty) {
return tankManager.drain(new FluidStack(productTank.getFluidType(), quantityMax), doEmpty);
return tankManager.drain(productTank.getFluidType(), quantityMax, doEmpty);
}
@Override
@@ -190,7 +190,7 @@ public class TileMoistener extends TileBase implements ISidedInventory, ILiquidT
return;
}
tankManager.drain(new FluidStack(resourceTank.getFluidType(), 1), true);
tankManager.drain(resourceTank.getFluidType(), 1, true);
burnTime -= speed;
productionTime -= speed;