本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}