本文整理汇总了Java中mekanism.api.gas.GasTank.draw方法的典型用法代码示例。如果您正苦于以下问题:Java GasTank.draw方法的具体用法?Java GasTank.draw怎么用?Java GasTank.draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mekanism.api.gas.GasTank
的用法示例。
在下文中一共展示了GasTank.draw方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: draw
import mekanism.api.gas.GasTank; //导入方法依赖的package包/类
/**
* Draws the needed amount of gas from each tank.
* @param leftTank - left tank to draw from
* @param rightTank - right tank to draw from
*/
public void draw(GasTank leftTank, GasTank rightTank)
{
if(meets(new ChemicalPairOutput(leftTank.getGas(), rightTank.getGas())))
{
leftTank.draw(leftGas.amount, true);
rightTank.draw(rightGas.amount, true);
}
else if(meets(new ChemicalPairOutput(rightTank.getGas(), leftTank.getGas())))
{
leftTank.draw(rightGas.amount, true);
rightTank.draw(leftGas.amount, true);
}
}
示例2: use
import mekanism.api.gas.GasTank; //导入方法依赖的package包/类
public boolean use(ItemStack[] inventory, int index, FluidTank fluidTank, GasTank gasTank, boolean deplete)
{
if(meets(new PressurizedInput(inventory[index], fluidTank.getFluid(), gasTank.getGas())))
{
if(deplete)
{
inventory[index] = StackUtils.subtract(inventory[index], theSolid);
fluidTank.drain(theFluid.amount, true);
gasTank.draw(theGas.amount, true);
}
return true;
}
return false;
}
示例3: useGas
import mekanism.api.gas.GasTank; //导入方法依赖的package包/类
public boolean useGas(GasTank gasTank, boolean deplete, int scale)
{
if(gasTank.getGasType() == ingredient.getGas() && gasTank.getStored() >= ingredient.amount*scale)
{
gasTank.draw(ingredient.amount*scale, deplete);
return true;
}
return false;
}
示例4: useGas
import mekanism.api.gas.GasTank; //导入方法依赖的package包/类
public boolean useGas(GasTank leftTank, GasTank rightTank, boolean deplete, int scale)
{
int leftAmount = leftGas.amount * scale;
int rightAmount = rightGas.amount * scale;
if(leftTank.canDraw(leftGas.getGas()) && rightTank.canDraw(rightGas.getGas()))
{
if(leftTank.getStored() >= leftAmount && rightTank.getStored() >= rightAmount)
{
leftTank.draw(leftAmount, deplete);
rightTank.draw(rightAmount, deplete);
return true;
}
}
else if(leftTank.canDraw(rightGas.getGas()) && rightTank.canDraw(leftGas.getGas()))
{
if(leftTank.getStored() >= rightAmount && rightTank.getStored() >= leftAmount)
{
leftTank.draw(rightAmount, deplete);
rightTank.draw(leftAmount, deplete);
return true;
}
}
return false;
}
示例5: draw
import mekanism.api.gas.GasTank; //导入方法依赖的package包/类
/**
* Draws the needed amount of gas from each tank.
* @param leftTank - left tank to draw from
* @param rightTank - right tank to draw from
*/
public void draw(GasTank leftTank, GasTank rightTank)
{
if(meets(new ChemicalPairInput(leftTank.getGas(), rightTank.getGas())))
{
leftTank.draw(leftGas.amount, true);
rightTank.draw(rightGas.amount, true);
}
else if(meets(new ChemicalPairInput(rightTank.getGas(), leftTank.getGas())))
{
leftTank.draw(rightGas.amount, true);
rightTank.draw(leftGas.amount, true);
}
}
示例6: useSecondary
import mekanism.api.gas.GasTank; //导入方法依赖的package包/类
public boolean useSecondary(GasTank gasTank, int amountToUse, boolean deplete)
{
if(gasTank.getGasType() == gasType && gasTank.getStored() >= amountToUse)
{
gasTank.draw(amountToUse, deplete);
return true;
}
return false;
}
示例7: draw
import mekanism.api.gas.GasTank; //导入方法依赖的package包/类
/**
* Draws the needed amount of gas from each tank.
* @param leftTank - left tank to draw from
* @param rightTank - right tank to draw from
*/
public void draw(GasTank leftTank, GasTank rightTank)
{
if(meets(new ChemicalPair(leftTank.getGas(), rightTank.getGas())))
{
leftTank.draw(leftGas.amount, true);
rightTank.draw(rightGas.amount, true);
}
else if(meets(new ChemicalPair(rightTank.getGas(), leftTank.getGas())))
{
leftTank.draw(rightGas.amount, true);
rightTank.draw(leftGas.amount, true);
}
}