当前位置: 首页>>代码示例>>Java>>正文


Java GasTank.draw方法代码示例

本文整理汇总了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);
	}
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:19,代码来源:ChemicalPairOutput.java

示例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;
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:15,代码来源:PressurizedInput.java

示例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;
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:12,代码来源:GasInput.java

示例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;
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:29,代码来源:ChemicalPairInput.java

示例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);
	}
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:19,代码来源:ChemicalPairInput.java

示例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;
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:11,代码来源:AdvancedMachineInput.java

示例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);
	}
}
 
开发者ID:4Space,项目名称:4-Space-Legacy,代码行数:19,代码来源:ChemicalPair.java


注:本文中的mekanism.api.gas.GasTank.draw方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。