本文整理汇总了Java中appeng.api.networking.security.BaseActionSource类的典型用法代码示例。如果您正苦于以下问题:Java BaseActionSource类的具体用法?Java BaseActionSource怎么用?Java BaseActionSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BaseActionSource类属于appeng.api.networking.security包,在下文中一共展示了BaseActionSource类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: extractEssentia
import appeng.api.networking.security.BaseActionSource; //导入依赖的package包/类
@Override
public long extractEssentia( final Aspect aspect, final long amount, final Actionable mode, final BaseActionSource source, final boolean powered )
{
if( powered )
{
// Simulate power extraction
double powerRequest = EssentiaMonitor.AE_PER_ESSENTIA * amount;
double powerReceived = this.energyGrid.extractAEPower( powerRequest, Actionable.SIMULATE, PowerMultiplier.CONFIG );
// Was enough power extracted?
if( powerReceived < powerRequest )
{
// Not enough power
return 0;
}
}
// Extract
long extractedAmount = this.internalMonitor.extractEssentia( aspect, amount, mode, source, false );
// Extract power if modulating
if( ( extractedAmount > 0 ) && ( powered ) && ( mode == Actionable.MODULATE ) )
{
this.energyGrid.extractAEPower( EssentiaMonitor.AE_PER_ESSENTIA * extractedAmount, Actionable.MODULATE, PowerMultiplier.CONFIG );
}
return extractedAmount;
}
开发者ID:Nividica,项目名称:ThaumicEnergistics,代码行数:29,代码来源:EssentiaPassThroughMonitor.java
示例17: injectEssentia
import appeng.api.networking.security.BaseActionSource; //导入依赖的package包/类
@Override
public long injectEssentia( final Aspect aspect, final long amount, final Actionable mode, final BaseActionSource source, final boolean powered )
{
if( powered )
{
// Simulate power extraction
double powerRequest = EssentiaMonitor.AE_PER_ESSENTIA * amount;
double powerReceived = this.energyGrid.extractAEPower( powerRequest, Actionable.SIMULATE, PowerMultiplier.CONFIG );
// Was enough power extracted?
if( powerReceived < powerRequest )
{
// Not enough power
return 0;
}
}
// Inject
long rejectedAmount = this.internalMonitor.injectEssentia( aspect, amount, mode, source, false );
long injectedAmount = amount - rejectedAmount;
// Extract power if modulating
if( ( injectedAmount > 0 ) && ( powered ) && ( mode == Actionable.MODULATE ) )
{
this.energyGrid.extractAEPower( EssentiaMonitor.AE_PER_ESSENTIA * injectedAmount, Actionable.MODULATE, PowerMultiplier.CONFIG );
}
return rejectedAmount;
}
开发者ID:Nividica,项目名称:ThaumicEnergistics,代码行数:30,代码来源:EssentiaPassThroughMonitor.java
示例18: injectEssentiaSafely
import appeng.api.networking.security.BaseActionSource; //导入依赖的package包/类
/**
* Mirror method of the injectEssentia. Used to defer power calculations, because the simulation is not always accurate, and Essentia gas should
* not be stored in partial amounts.
*
* @param aspect
* @param amount
* @param mode
* @param source
* @return Amount that was <strong>not</strong> injected
*/
private long injectEssentiaSafely( final Aspect aspect, final long amount, final Actionable mode, final BaseActionSource source,
final GaseousEssentia essentiaGas )
{
// Create the fluid request
IAEFluidStack fluidRequest = EssentiaConversionHelper.INSTANCE.createAEFluidStackInEssentiaUnits( essentiaGas, amount );
// Inject fluid
IAEFluidStack fluidRejected = this.fluidMonitor.injectItems( fluidRequest, mode, source );
// Was any rejected?
if( ( fluidRejected != null ) && ( fluidRejected.getStackSize() > 0 ) )
{
if( fluidRejected.getStackSize() == fluidRequest.getStackSize() )
{
// All essentia was rejected
return amount;
}
// Calculate the adjusted amount, essentia gas can not be stored in partial units
long rejectedAdjustedAmount = EssentiaConversionHelper.INSTANCE.convertFluidAmountToEssentiaAmount( fluidRejected.getStackSize() );
return rejectedAdjustedAmount;
}
// All essentia was accepted.
return 0;
}
开发者ID:Nividica,项目名称:ThaumicEnergistics,代码行数:37,代码来源:EssentiaMonitor.java
示例19: postChange
import appeng.api.networking.security.BaseActionSource; //导入依赖的package包/类
@Override
public void postChange( final IBaseMonitor<IAEItemStack> monitor, final Iterable<IAEItemStack> change, final BaseActionSource actionSource )
{
for( IAEItemStack stack : change )
{
// Is the stack craftable, has NBT tag, and is a crafting aspect?
if( stack.isCraftable() && stack.hasTagCompound() && ( stack.getItem() instanceof ItemCraftingAspect ) )
{
this.gridCache.markForUpdate();
break;
}
}
}
开发者ID:Nividica,项目名称:ThaumicEnergistics,代码行数:14,代码来源:CraftingAspect_ItemWatcher.java
示例20: extractItems
import appeng.api.networking.security.BaseActionSource; //导入依赖的package包/类
@Override
public IAEFluidStack extractItems( final IAEFluidStack request, final Actionable mode, final BaseActionSource source )
{
// Ensure we have an internal handler
if( this.internalHandler != null )
{
// Pass to handler
return this.internalHandler.extractItems( request, mode, source );
}
// No handler
return null;
}
开发者ID:Nividica,项目名称:ThaumicEnergistics,代码行数:14,代码来源:HandlerEssentiaStorageBusDuality.java
注:本文中的appeng.api.networking.security.BaseActionSource类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论