Crash fix
This commit is contained in:
parent
462c5a91b0
commit
ebe48abd84
1 changed files with 10 additions and 2 deletions
|
@ -47,7 +47,11 @@ public interface ITankManager
|
||||||
|
|
||||||
int toInsert = Math.min(gasTank.getStored(), ItemGaugeDropper.CAPACITY-dropperStored);
|
int toInsert = Math.min(gasTank.getStored(), ItemGaugeDropper.CAPACITY-dropperStored);
|
||||||
GasStack drawn = gasTank.draw(toInsert, true);
|
GasStack drawn = gasTank.draw(toInsert, true);
|
||||||
dropper.setGas(stack, new GasStack(drawn.getGas(), dropperStored+(drawn != null ? drawn.amount : 0)));
|
|
||||||
|
if(drawn != null)
|
||||||
|
{
|
||||||
|
dropper.setGas(stack, new GasStack(drawn.getGas(), dropperStored+(drawn != null ? drawn.amount : 0)));
|
||||||
|
}
|
||||||
|
|
||||||
((EntityPlayerMP)player).sendContainerAndContentsToPlayer(player.openContainer, player.openContainer.getInventory());
|
((EntityPlayerMP)player).sendContainerAndContentsToPlayer(player.openContainer, player.openContainer.getInventory());
|
||||||
}
|
}
|
||||||
|
@ -88,7 +92,11 @@ public interface ITankManager
|
||||||
|
|
||||||
int toInsert = Math.min(fluidTank.getFluidAmount(), ItemGaugeDropper.CAPACITY-dropperStored);
|
int toInsert = Math.min(fluidTank.getFluidAmount(), ItemGaugeDropper.CAPACITY-dropperStored);
|
||||||
FluidStack drawn = fluidTank.drain(toInsert, true);
|
FluidStack drawn = fluidTank.drain(toInsert, true);
|
||||||
dropper.setFluid(stack, new FluidStack(drawn.getFluid(), dropperStored+(drawn != null ? drawn.amount : 0)));
|
|
||||||
|
if(drawn != null)
|
||||||
|
{
|
||||||
|
dropper.setFluid(stack, new FluidStack(drawn.getFluid(), dropperStored+(drawn != null ? drawn.amount : 0)));
|
||||||
|
}
|
||||||
|
|
||||||
((EntityPlayerMP)player).sendContainerAndContentsToPlayer(player.openContainer, player.openContainer.getInventory());
|
((EntityPlayerMP)player).sendContainerAndContentsToPlayer(player.openContainer, player.openContainer.getInventory());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue