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


Java StorageChannel类代码示例

本文整理汇总了Java中appeng.api.storage.StorageChannel的典型用法代码示例。如果您正苦于以下问题:Java StorageChannel类的具体用法?Java StorageChannel怎么用?Java StorageChannel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getMeta

import appeng.api.storage.StorageChannel; //导入依赖的package包/类
@Override
public Object getMeta(Item target, ItemStack stack) {
	IMEInventoryHandler<?> inventory = AEApi.instance().registries().cell().getCellInventory(stack, null, StorageChannel.ITEMS);// get the inventory handler from ae api
	if (inventory instanceof ICellInventoryHandler) {
		ICellInventoryHandler handler = (ICellInventoryHandler)inventory;
		ICellInventory cellInventory = handler.getCellInv();
		if (cellInventory != null) {
			Map<String, Object> ret = Maps.newHashMap();

			ret.put("preformatted", handler.isPreformatted());
			ret.put("fuzzy", handler.isFuzzy());
			ret.put("freeBytes", cellInventory.getFreeBytes());
			ret.put("totalBytes", cellInventory.getTotalBytes());
			ret.put("usedBytes", cellInventory.getUsedBytes());
			ret.put("totalTypes", cellInventory.getTotalItemTypes());
			ret.put("usedTypes", cellInventory.getStoredItemTypes());
			ret.put("freeTypes", cellInventory.getRemainingItemTypes());

			return ret;
		}
	}

	return null;
}
 
开发者ID:OpenMods,项目名称:OpenPeripheral-Integration,代码行数:25,代码来源:StorageCellMetaProvider.java

示例2: getCellArray

import appeng.api.storage.StorageChannel; //导入依赖的package包/类
/**
 * Gets the 'cell' handler for the storage bus.
 */
@Override
public List<IMEInventoryHandler> getCellArray( final StorageChannel channel )
{
	// Create a new list
	List<IMEInventoryHandler> list = new ArrayList<IMEInventoryHandler>();

	// Is this the fluid channel?
	if( channel == StorageChannel.FLUIDS )
	{
		// Add our handler
		list.add( this.handler );
	}

	// Return the list
	return list;

}
 
开发者ID:Nividica,项目名称:ThaumicEnergistics,代码行数:21,代码来源:PartEssentiaStorageBus.java

示例3: onStackChange

import appeng.api.storage.StorageChannel; //导入依赖的package包/类
@Override
@Optional.Method(modid = ModIds.AE2)
public void onStackChange(IItemList arg0, IAEStack arg1, IAEStack arg2, BaseActionSource arg3, StorageChannel arg4){
    if(craftingGrid != null) {
        ICraftingGrid grid = (ICraftingGrid)craftingGrid;
        for(int i = 0; i < getFilters().getSizeInventory(); i++) {
            ItemStack s = getFilters().getStackInSlot(i);
            if(s != null) {
                if(!grid.isRequesting(AEApi.instance().storage().createItemStack(s))) {
                    getFilters().setInventorySlotContents(i, null);
                    notifyNetworkOfCraftingChange();
                }
            }
        }
    }
}
 
开发者ID:MineMaarten,项目名称:PneumaticCraft,代码行数:17,代码来源:SemiBlockRequester.java

示例4: postAlterationToHostGrid

import appeng.api.storage.StorageChannel; //导入依赖的package包/类
/**
 * Lets the host grid know that the storage amount has changed.
 *
 * @param change
 */
protected void postAlterationToHostGrid( final Iterable<IAEFluidStack> change )
{
	try
	{
		if( this.partStorageBus.getActionableNode().isActive() )
		{
			this.partStorageBus.getGridBlock().getStorageGrid().postAlterationOfStoredItems( StorageChannel.FLUIDS, change, this.machineSource );
		}
	}
	catch( Exception e )
	{

	}
}
 
开发者ID:Nividica,项目名称:ThaumicEnergistics,代码行数:20,代码来源:HandlerEssentiaStorageBusBase.java

示例5: getNewMonitor

import appeng.api.storage.StorageChannel; //导入依赖的package包/类
@Override
protected IMEEssentiaMonitor getNewMonitor()
{
	try
	{
		IMEInventoryHandler<IAEFluidStack> handler = null;

		// Get the chest handler
		List<IMEInventoryHandler> hostCellArray = this.hostChest.getCellArray( StorageChannel.FLUIDS );
		if( hostCellArray.size() > 0 )
		{
			handler = hostCellArray.get( 0 );
		}

		// Get the monitor
		if( handler != null )
		{
			// Create the essentia monitor
			return new EssentiaMonitor( (IMEMonitor<IAEFluidStack>)handler, this.hostChest.getProxy().getEnergy(), this );
		}
	}
	catch( Exception e )
	{
		e.printStackTrace();
	}

	return null;
}
 
开发者ID:Nividica,项目名称:ThaumicEnergistics,代码行数:29,代码来源:ContainerEssentiaCell.java

示例6: getStacksInItem

import appeng.api.storage.StorageChannel; //导入依赖的package包/类
@Override
public void getStacksInItem(ItemStack stack, List<ItemStack> curStacks){
    IMEInventoryHandler<IAEItemStack> cellInventoryHandler = cellRegistry.getCellInventory(stack, null, StorageChannel.ITEMS);
    if(cellInventoryHandler != null) {
        IItemList<IAEItemStack> cellItemList = storageHelper.createItemList();
        cellInventoryHandler.getAvailableItems(cellItemList);
        for(IAEItemStack aeStack : cellItemList) {
            ItemStack st = aeStack.getItemStack();
            st.stackSize = (int)aeStack.getStackSize();//Do another getStacksize, as above retrieval caps to 64.
            curStacks.add(st);
        }
    }
}
 
开发者ID:MineMaarten,项目名称:PneumaticCraft,代码行数:14,代码来源:AE2DiskInventoryItemHandler.java

示例7: getCellArray

import appeng.api.storage.StorageChannel; //导入依赖的package包/类
@Override
@Optional.Method(modid = ModIds.AE2)
public List<IMEInventoryHandler> getCellArray(StorageChannel channel){
    if(channel == StorageChannel.ITEMS) {
        return Arrays.asList((IMEInventoryHandler)this);
    } else {
        return new ArrayList<IMEInventoryHandler>();
    }
}
 
开发者ID:MineMaarten,项目名称:PneumaticCraft,代码行数:10,代码来源:SemiBlockRequester.java

示例8: getCellArray

import appeng.api.storage.StorageChannel; //导入依赖的package包/类
@Override
public List<IMEInventoryHandler> getCellArray(StorageChannel storageChannel)
{
    if (storageChannel == StorageChannel.ITEMS)
    {
        return Arrays.asList((IMEInventoryHandler) getInternalHandler());
    }
    return Collections.emptyList();
}
 
开发者ID:Dynious,项目名称:RefinedRelocation,代码行数:10,代码来源:TileMESortingInterface.java

示例9: MENetworkStorageEvent

import appeng.api.storage.StorageChannel; //导入依赖的package包/类
public MENetworkStorageEvent(IMEMonitor o, StorageChannel chan) {
	monitor = o;
	channel = chan;
}
 
开发者ID:amadornes,项目名称:Framez,代码行数:5,代码来源:MENetworkStorageEvent.java

示例10: MENetworkStorageEvent

import appeng.api.storage.StorageChannel; //导入依赖的package包/类
public MENetworkStorageEvent(IMEMonitor o, StorageChannel chan) {
	this.monitor = o;
	this.channel = chan;
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:5,代码来源:MENetworkStorageEvent.java

示例11: MENetworkStorageEvent

import appeng.api.storage.StorageChannel; //导入依赖的package包/类
public MENetworkStorageEvent(IMEMonitor o, StorageChannel chan) {
    monitor = o;
    channel = chan;
}
 
开发者ID:AgileMods,项目名称:MateriaMuto,代码行数:5,代码来源:MENetworkStorageEvent.java

示例12: getChannel

import appeng.api.storage.StorageChannel; //导入依赖的package包/类
/**
 * Gets the storage channel for the storage bus.
 */
@Override
public StorageChannel getChannel()
{
	return StorageChannel.FLUIDS;
}
 
开发者ID:Nividica,项目名称:ThaumicEnergistics,代码行数:9,代码来源:HandlerEssentiaStorageBusBase.java

示例13: getChannel

import appeng.api.storage.StorageChannel; //导入依赖的package包/类
/**
 * Which storage channel this cell is on.
 */
@Override
public StorageChannel getChannel()
{
	return StorageChannel.FLUIDS;
}
 
开发者ID:Nividica,项目名称:ThaumicEnergistics,代码行数:9,代码来源:HandlerItemEssentiaCell.java

示例14: MENetworkStorageEvent

import appeng.api.storage.StorageChannel; //导入依赖的package包/类
public MENetworkStorageEvent( IMEMonitor o, StorageChannel chan )
{
	this.monitor = o;
	this.channel = chan;
}
 
开发者ID:MineMaarten,项目名称:PneumaticCraft,代码行数:6,代码来源:MENetworkStorageEvent.java

示例15: getChannel

import appeng.api.storage.StorageChannel; //导入依赖的package包/类
@Override
@Optional.Method(modid = ModIds.AE2)
public StorageChannel getChannel(){
    return StorageChannel.ITEMS;
}
 
开发者ID:MineMaarten,项目名称:PneumaticCraft,代码行数:6,代码来源:SemiBlockRequesterAE.java


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