本文整理汇总了Java中appeng.api.networking.security.BaseActionSource类的典型用法代码示例。如果您正苦于以下问题:Java BaseActionSource类的具体用法?Java BaseActionSource怎么用?Java BaseActionSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BaseActionSource类属于appeng.api.networking.security包,在下文中一共展示了BaseActionSource类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extractItems
import appeng.api.networking.security.BaseActionSource; //导入依赖的package包/类
/**
* Attempts to extract the gas from the sub-grid.
*/
@Override
public IAEFluidStack extractItems( final IAEFluidStack request, final Actionable mode, final BaseActionSource source )
{
// Is the fluid an essentia gas?
if( this.isFluidEssentiaGas( request ) )
{
if( this.handler != null )
{
// Extract the gas
IAEFluidStack extractedGas = this.handler.extractItems( request, mode, source );
return extractedGas;
}
}
return null;
}
示例2: injectItems
import appeng.api.networking.security.BaseActionSource; //导入依赖的package包/类
/**
* Attempts to inject the gas into the sub-network.
*/
@Override
public IAEFluidStack injectItems( final IAEFluidStack input, final Actionable mode, final BaseActionSource source )
{
// Is the fluid an essentia gas?
if( this.isFluidEssentiaGas( input ) )
{
if( this.handler != null )
{
// Inject the gas
IAEFluidStack remainingGas = this.handler.injectItems( input, mode, source );
return remainingGas;
}
}
return input;
}
示例3: extractItems
import appeng.api.networking.security.BaseActionSource; //导入依赖的package包/类
/**
* The creative cell can only provide essentia based on its parition table.
*/
@Override
public IAEFluidStack extractItems( final IAEFluidStack request, final Actionable mode, final BaseActionSource src )
{
// Ensure there is a request, and that it is an essentia gas
if( ( request != null ) && ( request.getFluid() != null ) && ( request.getFluid() instanceof GaseousEssentia ) )
{
// Get the aspect of the essentia
Aspect requestAspect = ( (GaseousEssentia)request.getFluid() ).getAspect();
// Is the cell partitioned for this aspect?
if( ( requestAspect != null ) && ( this.partitionAspects.contains( requestAspect ) ) )
{
return request.copy();
}
}
return null;
}
示例4: notifyListenersOfChange
import appeng.api.networking.security.BaseActionSource; //导入依赖的package包/类
protected void notifyListenersOfChange(Iterable<StackType> diff, BaseActionSource src)
{
hasChanged = true;// need to update the cache.
Iterator<Entry<IMEMonitorHandlerReceiver<StackType>, Object>> i = getListeners();
while (i.hasNext())
{
Entry<IMEMonitorHandlerReceiver<StackType>, Object> o = i.next();
IMEMonitorHandlerReceiver<StackType> receiver = o.getKey();
if ( receiver.isValid( o.getValue() ) )
receiver.postChange( this, diff, src );
else
i.remove();
}
}
示例5: monitorDifference
import appeng.api.networking.security.BaseActionSource; //导入依赖的package包/类
private StackType monitorDifference(IAEStack original, StackType leftOvers, boolean extraction, BaseActionSource src)
{
StackType diff = (StackType) original.copy();
if ( extraction )
diff.setStackSize( leftOvers == null ? 0 : -leftOvers.getStackSize() );
else if ( leftOvers != null )
diff.decStackSize( leftOvers.getStackSize() );
if ( diff.getStackSize() != 0 )
postChangesToListeners( ImmutableList.of( diff ), src );
return leftOvers;
}
示例6: injectItems
import appeng.api.networking.security.BaseActionSource; //导入依赖的package包/类
@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);
}
示例7: notifyListenersOfChange
import appeng.api.networking.security.BaseActionSource; //导入依赖的package包/类
protected void notifyListenersOfChange(Iterable<StackType> diff, BaseActionSource src)
{
this.hasChanged = true;// need to update the cache.
Iterator<Entry<IMEMonitorHandlerReceiver<StackType>, Object>> i = this.getListeners();
while (i.hasNext())
{
Entry<IMEMonitorHandlerReceiver<StackType>, Object> o = i.next();
IMEMonitorHandlerReceiver<StackType> receiver = o.getKey();
if ( receiver.isValid( o.getValue() ) )
receiver.postChange( this, diff, src );
else
i.remove();
}
}
示例8: monitorDifference
import appeng.api.networking.security.BaseActionSource; //导入依赖的package包/类
private StackType monitorDifference(IAEStack original, StackType leftOvers, boolean extraction, BaseActionSource src)
{
StackType diff = (StackType) original.copy();
if ( extraction )
diff.setStackSize( leftOvers == null ? 0 : -leftOvers.getStackSize() );
else if ( leftOvers != null )
diff.decStackSize( leftOvers.getStackSize() );
if ( diff.getStackSize() != 0 )
this.postChangesToListeners( ImmutableList.of( diff ), src );
return leftOvers;
}
示例9: injectItems
import appeng.api.networking.security.BaseActionSource; //导入依赖的package包/类
@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);
}
示例10: extractItems
import appeng.api.networking.security.BaseActionSource; //导入依赖的package包/类
@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);
}
示例11: notifyListenersOfChange
import appeng.api.networking.security.BaseActionSource; //导入依赖的package包/类
protected void notifyListenersOfChange(Iterable<StackType> diff, BaseActionSource src) {
hasChanged = true;// need to update the cache.
Iterator<Entry<IMEMonitorHandlerReceiver<StackType>, Object>> i = getListeners();
while (i.hasNext()) {
Entry<IMEMonitorHandlerReceiver<StackType>, Object> o = i.next();
IMEMonitorHandlerReceiver<StackType> recv = o.getKey();
if (recv.isValid(o.getValue())) {
recv.postChange(this, diff, src);
} else {
i.remove();
}
}
}
示例12: monitorDiffrence
import appeng.api.networking.security.BaseActionSource; //导入依赖的package包/类
private StackType monitorDiffrence(IAEStack original, StackType leftOvers, boolean extraction, BaseActionSource src) {
StackType diff = (StackType) original.copy();
if (extraction) {
diff.setStackSize(leftOvers == null ? 0 : -leftOvers.getStackSize());
} else if (leftOvers != null) {
diff.decStackSize(leftOvers.getStackSize());
}
if (diff.getStackSize() != 0) {
postChangesToListeners(ImmutableList.of(diff), src);
}
return leftOvers;
}
示例13: injectItems
import appeng.api.networking.security.BaseActionSource; //导入依赖的package包/类
@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);
}
示例14: checkSecurityPermission
import appeng.api.networking.security.BaseActionSource; //导入依赖的package包/类
/**
* Returns if the player has the requested permission or not.
*
* @param perm
* @param actionSource
* @return
*/
private boolean checkSecurityPermission( final SecurityPermissions perm, final BaseActionSource actionSource )
{
// Ensure there is an action source.
if( actionSource == null )
{
return false;
}
// Get the source node
IGridNode sourceNode = null;
if( actionSource instanceof MachineSource )
{
sourceNode = ( (MachineSource)actionSource ).via.getActionableNode();
}
else if( actionSource instanceof PlayerSource )
{
sourceNode = ( (PlayerSource)actionSource ).via.getActionableNode();
}
// Ensure there is a node
if( sourceNode == null )
{
return false;
}
// Get the security grid for the node.
ISecurityGrid sGrid = sourceNode.getGrid().getCache( ISecurityGrid.class );
// Return the permission.
return sGrid.hasPermission( this.player, perm );
}
示例15: postChange
import appeng.api.networking.security.BaseActionSource; //导入依赖的package包/类
/**
* Called when the amount of an item on the network changes.
*/
@Override
public void postChange( final IBaseMonitor<IAEItemStack> monitor, final Iterable<IAEItemStack> changes, final BaseActionSource actionSource )
{
if( this.monitor == null )
{
return;
}
for( IAEItemStack change : changes )
{
// Get the total amount of the item in the network
IAEItemStack newAmount = this.monitor.getStorageList().findPrecise( change );
// Is there no more?
if( newAmount == null )
{
// Copy the item type from the change
newAmount = change.copy();
// Set amount to 0
newAmount.setStackSize( 0 );
}
// Send the change to the client
Packet_C_ArcaneCraftingTerminal.stackAmountChanged( this.player, newAmount );
}
}