本文整理汇总了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;
}
示例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;
}
示例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();
}
}
}
}
}
示例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 )
{
}
}
示例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;
}
示例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);
}
}
}
示例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>();
}
}
示例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();
}
示例9: MENetworkStorageEvent
import appeng.api.storage.StorageChannel; //导入依赖的package包/类
public MENetworkStorageEvent(IMEMonitor o, StorageChannel chan) {
monitor = o;
channel = chan;
}
示例10: MENetworkStorageEvent
import appeng.api.storage.StorageChannel; //导入依赖的package包/类
public MENetworkStorageEvent(IMEMonitor o, StorageChannel chan) {
this.monitor = o;
this.channel = chan;
}
示例11: MENetworkStorageEvent
import appeng.api.storage.StorageChannel; //导入依赖的package包/类
public MENetworkStorageEvent(IMEMonitor o, StorageChannel chan) {
monitor = o;
channel = chan;
}
示例12: getChannel
import appeng.api.storage.StorageChannel; //导入依赖的package包/类
/**
* Gets the storage channel for the storage bus.
*/
@Override
public StorageChannel getChannel()
{
return StorageChannel.FLUIDS;
}
示例13: getChannel
import appeng.api.storage.StorageChannel; //导入依赖的package包/类
/**
* Which storage channel this cell is on.
*/
@Override
public StorageChannel getChannel()
{
return StorageChannel.FLUIDS;
}
示例14: MENetworkStorageEvent
import appeng.api.storage.StorageChannel; //导入依赖的package包/类
public MENetworkStorageEvent( IMEMonitor o, StorageChannel chan )
{
this.monitor = o;
this.channel = chan;
}
示例15: getChannel
import appeng.api.storage.StorageChannel; //导入依赖的package包/类
@Override
@Optional.Method(modid = ModIds.AE2)
public StorageChannel getChannel(){
return StorageChannel.ITEMS;
}