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


Java Actionable.SIMULATE属性代码示例

本文整理汇总了Java中appeng.api.config.Actionable.SIMULATE属性的典型用法代码示例。如果您正苦于以下问题:Java Actionable.SIMULATE属性的具体用法?Java Actionable.SIMULATE怎么用?Java Actionable.SIMULATE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在appeng.api.config.Actionable的用法示例。


在下文中一共展示了Actionable.SIMULATE属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: injectItems

@Override
public StackType injectItems(StackType input, Actionable mode, BaseActionSource src)
{
	if ( mode == Actionable.SIMULATE )
		return getHandler().injectItems( input, mode, src );
	return monitorDifference(input.copy(), getHandler().injectItems(input, mode, src), false, src);
}
 
开发者ID:amadornes,项目名称:Framez,代码行数:7,代码来源:MEMonitorHandler.java

示例2: extractItems

@Override
public StackType extractItems(StackType request, Actionable mode, BaseActionSource src)
{
	if ( mode == Actionable.SIMULATE )
		return getHandler().extractItems( request, mode, src );
	return monitorDifference(request.copy(), getHandler().extractItems(request, mode, src), true, src);
}
 
开发者ID:amadornes,项目名称:Framez,代码行数:7,代码来源:MEMonitorHandler.java

示例3: injectItems

@Override
public StackType injectItems(StackType input, Actionable mode, BaseActionSource src)
{
	if ( mode == Actionable.SIMULATE )
		return this.getHandler().injectItems( input, mode, src );
	return this.monitorDifference(input.copy(), this.getHandler().injectItems(input, mode, src), false, src);
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:7,代码来源:MEMonitorHandler.java

示例4: extractItems

@Override
public StackType extractItems(StackType request, Actionable mode, BaseActionSource src)
{
	if ( mode == Actionable.SIMULATE )
		return this.getHandler().extractItems( request, mode, src );
	return this.monitorDifference(request.copy(), this.getHandler().extractItems(request, mode, src), true, src);
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:7,代码来源:MEMonitorHandler.java

示例5: injectItems

@Override
public StackType injectItems(StackType input, Actionable mode, BaseActionSource src) {
    if (mode == Actionable.SIMULATE) {
        return getHandler().injectItems(input, mode, src);
    }
    return monitorDiffrence((StackType) input.copy(), getHandler().injectItems(input, mode, src), false, src);
}
 
开发者ID:AgileMods,项目名称:MateriaMuto,代码行数:7,代码来源:MEMonitorHandler.java

示例6: extractItems

@Override
public StackType extractItems(StackType request, Actionable mode, BaseActionSource src) {
    if (mode == Actionable.SIMULATE) {
        return getHandler().extractItems(request, mode, src);
    }
    return monitorDiffrence((StackType) request.copy(), getHandler().extractItems(request, mode, src), true, src);
}
 
开发者ID:AgileMods,项目名称:MateriaMuto,代码行数:7,代码来源:MEMonitorHandler.java

示例7: extractPower

/**
 * Uses some of the terminals stored power. This does take into account the extra power required for wireless operations.
 *
 * @param amount
 * @return Returns the amount extracted.
 */
public double extractPower( final double amount, final Actionable mode )
{
	// Has power usage been disabled?
	if( ItemWirelessEssentiaTerminal.GLOBAL_POWER_MULTIPLIER == 0 )
	{
		// Lie and say it was taken.
		return amount;
	}

	// Adjust by the power multiplier
	double adjustedAmount = amount * this.wirelessPowerMultiplier;

	double extractedAmount = 0;
	// Simulation?
	if( mode == Actionable.SIMULATE )
	{
		// Return the amount stored, capped at amount
		extractedAmount = Math.min( this.wirelessTerminal.getAECurrentPower( this.wirelessItemstack ), adjustedAmount );
	}
	else
	{
		// Return the amount extracted.
		extractedAmount = this.wirelessTerminal.extractAEPower( this.wirelessItemstack, adjustedAmount );
	}

	// Adjust by the power multiplier
	extractedAmount /= this.wirelessPowerMultiplier;

	return extractedAmount;
}
 
开发者ID:Nividica,项目名称:ThaumicEnergistics,代码行数:36,代码来源:HandlerWirelessEssentiaTerminal.java

示例8: injectItems

@Override
public IAEFluidStack injectItems( final IAEFluidStack input, final Actionable mode, final BaseActionSource source )
{
	// Ensure input and output
	if( ( this.condenser == null ) || ( input == null ) || ( !this.canAccept( input ) ) )
	{
		return input;
	}

	// Ignore if simulation
	if( mode == Actionable.SIMULATE )
	{
		// Condenser can accept all.
		return null;
	}

	// Create the fluidstack
	IAEFluidStack injectStack = input.copy();

	// Set the amount to the Essentia units, NOT the fluid units
	injectStack.setStackSize( 500 * EssentiaConversionHelper.INSTANCE.convertFluidAmountToEssentiaAmount( input.getStackSize() ) );

	// Inject the fluid
	this.condenser.fill( this.partStorageBus.getSide().getOpposite(), injectStack.getFluidStack(), ( mode == Actionable.MODULATE ) );

	// Update the grid so that it doesn't thing we have stored the voided amount.
	this.postAlterationToHostGrid( ImmutableList.of( AEApi.instance().storage()
					.createFluidStack( new FluidStack( input.getFluid(), (int) -input.getStackSize() ) ) ) );

	// All fluid accepted.
	return null;
}
 
开发者ID:Nividica,项目名称:ThaumicEnergistics,代码行数:32,代码来源:HandlerEssentiaStorageBusCondenser.java


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