Fixed a couple of crashes reported on OpenEye

This commit is contained in:
CrazyPants committed 2014-07-15 12:03:11 +08:00
1 parent c0def671cd
commit d8d40b2330
2 files changed
+10 -7

No files matched your search

@@ -61,9 +61,10 @@ public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidCon
drained = tank.externalTank.drain(conDir.getOpposite(), amountAccepted, true);
if(drained == null || drained.amount <= 0) {
return false;
}
}
if(drained.amount != amountAccepted) {
Log.warn("EnderLiquidConduit.extractFrom: Extracted fluid volume is not equal to inserted volume. Drained=" + drained.amount + " filled=" + amountAccepted + " Fluid: " + drained + " Accepted=" + amountAccepted);
Log.warn("EnderLiquidConduit.extractFrom: Extracted fluid volume is not equal to inserted volume. Drained=" + drained.amount + " filled="
+ amountAccepted + " Fluid: " + drained + " Accepted=" + amountAccepted);
}
return true;
}
@@ -85,7 +86,7 @@ public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidCon
int filled = 0;
int remaining = resource.amount;
//TODO: Only change starting pos of iterator is doFill is true so a false then true returns the same
for (NetworkTank target : getIteratorForTank(tank)) {
if(!target.equals(tank) && target.acceptsOuput && target.isValid() && matchedFilter(resource, target.con, target.conDir, false)) {
int vol = target.externalTank.fill(target.tankDir, resource.copy(), doFill);
@@ -129,8 +130,10 @@ public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidCon
for (NetworkTank target : tanks) {
if(!target.equals(tank) && target.isValid()) {
FluidTankInfo[] tTanks = target.externalTank.getTankInfo(target.tankDir);
for (FluidTankInfo info : tTanks) {
res.add(info);
if(tTanks != null) {
for (FluidTankInfo info : tTanks) {
res.add(info);
}
}
}
}
+2 -2
View File
@@ -141,7 +141,7 @@ public class Util {
}
public static void dropItems(World world, ItemStack stack, double x, double y, double z, boolean doRandomSpread) {
if(stack.stackSize <= 0) {
if(stack == null || stack.stackSize <= 0) {
return;
}
@@ -165,7 +165,7 @@ public class Util {
}
public static void dropItems(World world, ItemStack stack, int x, int y, int z, boolean doRandomSpread) {
if(stack.stackSize <= 0) {
if(stack == null || stack.stackSize <= 0) {
return;
}