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


Java BaseActionSource类代码示例

本文整理汇总了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;
}
 
开发者ID:Nividica,项目名称:ThaumicEnergistics,代码行数:21,代码来源:HandlerEssentiaStorageBusInterface.java

示例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;
}
 
开发者ID:Nividica,项目名称:ThaumicEnergistics,代码行数:20,代码来源:HandlerEssentiaStorageBusInterface.java

示例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;
}
 
开发者ID:Nividica,项目名称:ThaumicEnergistics,代码行数:22,代码来源:HandlerItemEssentiaCellCreative.java

示例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();
	}
}
 
开发者ID:amadornes,项目名称:Framez,代码行数:15,代码来源:MEMonitorHandler.java

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

示例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);
}
 
开发者ID:amadornes,项目名称:Framez,代码行数:8,代码来源:MEMonitorHandler.java

示例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();
	}
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:15,代码来源:MEMonitorHandler.java

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

示例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);
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:8,代码来源:MEMonitorHandler.java

示例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);
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:8,代码来源:MEMonitorHandler.java

示例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();
        }
    }
}
 
开发者ID:AgileMods,项目名称:MateriaMuto,代码行数:14,代码来源:MEMonitorHandler.java

示例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;
}
 
开发者ID:AgileMods,项目名称:MateriaMuto,代码行数:16,代码来源:MEMonitorHandler.java

示例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);
}
 
开发者ID:AgileMods,项目名称:MateriaMuto,代码行数:8,代码来源:MEMonitorHandler.java

示例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 );
}
 
开发者ID:Nividica,项目名称:ThaumicEnergistics,代码行数:40,代码来源:ContainerEssentiaCellTerminalBase.java

示例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 );
	}
}
 
开发者ID:Nividica,项目名称:ThaumicEnergistics,代码行数:31,代码来源:ContainerPartArcaneCraftingTerminal.java


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