• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java StorageChannel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: getChannel

import appeng.api.storage.StorageChannel; //导入依赖的package包/类
@Method(modid = "appliedenergistics2")
@Override
public StorageChannel getChannel()
{
    return StorageChannel.ITEMS;
}
 
开发者ID:Dynious,项目名称:EnergyFromMatter,代码行数:7,代码来源:TileCreatorInterface.java


示例17: getChannel

import appeng.api.storage.StorageChannel; //导入依赖的package包/类
public StorageChannel getChannel()
{
    return StorageChannel.ITEMS;
}
 
开发者ID:Dynious,项目名称:RefinedRelocation,代码行数:5,代码来源:TileMESortingInterface.java


示例18: onStackChange

import appeng.api.storage.StorageChannel; //导入依赖的package包/类
/**
 * Called when a watched item changes amounts.
 * 
 * @param o changed item list
 * @param fullStack old stack
 * @param diffStack new stack
 * @param src action source
 * @param chan storage channel
 */
void onStackChange(IItemList o, IAEStack fullStack, IAEStack diffStack, BaseActionSource src, StorageChannel chan);
 
开发者ID:amadornes,项目名称:Framez,代码行数:11,代码来源:IStackWatcherHost.java


示例19: postAlterationOfStoredItems

import appeng.api.storage.StorageChannel; //导入依赖的package包/类
/**
 * Used to inform the network of alterations to the storage system that fall outside of the standard Network
 * operations, Examples, ME Chest inputs from the world, or a Storage Bus detecting modifications made to the chest
 * by an outside force.
 * 
 * Expects the input to have either a negative or a positive stack size to correspond to the injection, or
 * extraction operation.
 * 
 * @param input injected items
 */
void postAlterationOfStoredItems(StorageChannel chan, Iterable<? extends IAEStack> input, BaseActionSource src);
 
开发者ID:amadornes,项目名称:Framez,代码行数:12,代码来源:IStorageGrid.java


示例20: getChannel

import appeng.api.storage.StorageChannel; //导入依赖的package包/类
/**
 * @return ITEM or FLUID
 */
StorageChannel getChannel();
 
开发者ID:amadornes,项目名称:Framez,代码行数:5,代码来源:IAEStack.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PhysicsCollisionEvent类代码示例发布时间:2022-05-22
下一篇:
Java GetJournalStateResponseProto类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap