Merge branch 'master' of github.com:SirSengir/BuildCraft
This commit is contained in:
commit
e5a62dd1b5
2 changed files with 16 additions and 4 deletions
|
@ -233,10 +233,10 @@ public class TileRefinery extends TileMachine implements ITankContainer, IPowerR
|
||||||
if(liquid == null)
|
if(liquid == null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if(liquid.isLiquidEqual(new LiquidStack(slot1.liquidId, slot1.quantity, 0))) {
|
if(new LiquidStack(slot1.liquidId, slot1.quantity, 0).containsLiquid(liquid)) {
|
||||||
slot1.quantity -= liquid.amount;
|
slot1.quantity -= liquid.amount;
|
||||||
return true;
|
return true;
|
||||||
} else if(liquid.isLiquidEqual(new LiquidStack(slot2.liquidId, slot2.quantity, 0))) {
|
} else if(new LiquidStack(slot2.liquidId, slot2.quantity, 0).containsLiquid(liquid)) {
|
||||||
slot2.quantity -= liquid.amount;
|
slot2.quantity -= liquid.amount;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,7 +161,12 @@ public class TileTank extends TileBuildCraft implements ITankContainer
|
||||||
}
|
}
|
||||||
|
|
||||||
int used = below.tank.fill(tank.getLiquid(), true);
|
int used = below.tank.fill(tank.getLiquid(), true);
|
||||||
tank.drain(used, true);
|
if(used>0) {
|
||||||
|
hasUpdate= true; // not redundant because tank.drain operates on an ILiquidTank, not a tile
|
||||||
|
below.hasUpdate=true; // redundant because below.fill sets hasUpdate
|
||||||
|
|
||||||
|
tank.drain(used, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ITANKCONTAINER */
|
/* ITANKCONTAINER */
|
||||||
|
@ -183,9 +188,14 @@ public class TileTank extends TileBuildCraft implements ITankContainer
|
||||||
while(tankToFill != null && resource.amount > 0){
|
while(tankToFill != null && resource.amount > 0){
|
||||||
int used = tankToFill.tank.fill(resource, doFill);
|
int used = tankToFill.tank.fill(resource, doFill);
|
||||||
resource.amount -= used;
|
resource.amount -= used;
|
||||||
|
if(used>0)
|
||||||
|
tankToFill.hasUpdate=true;
|
||||||
|
|
||||||
totalUsed += used;
|
totalUsed += used;
|
||||||
tankToFill = getTankAbove(tankToFill);
|
tankToFill = getTankAbove(tankToFill);
|
||||||
}
|
}
|
||||||
|
if(totalUsed>0)
|
||||||
|
hasUpdate= true;
|
||||||
return totalUsed;
|
return totalUsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,7 +208,9 @@ public class TileTank extends TileBuildCraft implements ITankContainer
|
||||||
@Override
|
@Override
|
||||||
public LiquidStack drain(int tankIndex, int maxEmpty, boolean doDrain)
|
public LiquidStack drain(int tankIndex, int maxEmpty, boolean doDrain)
|
||||||
{
|
{
|
||||||
return getBottomTank().tank.drain(maxEmpty, doDrain);
|
TileTank bottom=getBottomTank();
|
||||||
|
bottom.hasUpdate=true;
|
||||||
|
return bottom.tank.drain(maxEmpty, doDrain);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue