本文整理汇总了Java中appeng.api.storage.data.IAEItemStack.getItem方法的典型用法代码示例。如果您正苦于以下问题:Java IAEItemStack.getItem方法的具体用法?Java IAEItemStack.getItem怎么用?Java IAEItemStack.getItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类appeng.api.storage.data.IAEItemStack
的用法示例。
在下文中一共展示了IAEItemStack.getItem方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convert
import appeng.api.storage.data.IAEItemStack; //导入方法依赖的package包/类
@Override
public Object convert(IConverter registry, IAEItemStack aeStack) {
ItemFingerprint fingerprint = new ItemFingerprint(aeStack.getItem(), aeStack.getItemDamage(), getTag(aeStack));
Map<String, Object> result = Maps.newHashMap();
result.put("fingerprint", fingerprint);
result.put("size", aeStack.getStackSize());
result.put("is_craftable", aeStack.isCraftable());
result.put("is_fluid", aeStack.isFluid());
result.put("is_item", aeStack.isItem());
return registry.fromJava(result);
}
示例2: isItemGUIBlacklisted
import appeng.api.storage.data.IAEItemStack; //导入方法依赖的package包/类
/**
* Hook for AE2s <em>GuiMeMonitorable.postUpdate()</em>.<br>
* Returning true will prevent the item from being displayed in GUI's.
* TODO: Expand this into registration list within the API.
*
* @param is
* @return
*/
public static boolean isItemGUIBlacklisted( final IAEItemStack is )
{
if( is.getItem() instanceof ItemCraftingAspect )
{
return true;
}
return false;
}
示例3: postChange
import appeng.api.storage.data.IAEItemStack; //导入方法依赖的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;
}
}
}
示例4: setupAEResults
import appeng.api.storage.data.IAEItemStack; //导入方法依赖的package包/类
/**
* Sets up all results, including container items.
*/
private void setupAEResults()
{
// Ensure the ingredient list is made
if( this.ingredientsAE == null )
{
this.setupAEIngredientList();
}
ArrayList<IAEItemStack> results = new ArrayList<IAEItemStack>();
// Add any container items
for( IAEItemStack stack : this.ingredientsAE )
{
if( stack == null )
{
continue;
}
// Container?
if( stack.getItem().hasContainerItem( stack.getItemStack() ) )
{
results.add( AEApi.instance().storage().createItemStack( stack.getItem().getContainerItem( stack.getItemStack() ) ) );
}
// Multiplier?
else if( stack.getStackSize() > 1 )
{
results.add( stack.copy().setStackSize( stack.getStackSize() - 1 ) );
}
// Primordial Pearl?
else if( ( stack.getItem() instanceof ItemEldritchObject ) && ( stack.getItemDamage() == 3 ) )
{
results.add( stack );
}
}
// Add result
results.add( this.result );
// Set the outputs
this.allResults = results.toArray( new IAEItemStack[results.size()] );
}
示例5: updateCacheToMatchNetwork
import appeng.api.storage.data.IAEItemStack; //导入方法依赖的package包/类
/**
* Add in any craftable aspects
*/
@Override
protected void updateCacheToMatchNetwork()
{
// Call super
super.updateCacheToMatchNetwork();
// Is the network powered?
if( !this.energyGrid.isNetworkPowered() )
{
return;
}
// Get the item monitor
IStorageGrid storage = (IStorageGrid)this.internalGrid.getCache( IStorageGrid.class );
IMEMonitor<IAEItemStack> itemMonitor = storage.getItemInventory();
// Get stored items
IItemList<IAEItemStack> storedItems = itemMonitor.getStorageList();
if( ( storedItems == null ) || ( storedItems.size() == 0 ) )
{
return;
}
// Create the aspect list
HashSet<Aspect> craftableAspects = new HashSet<Aspect>();
// Check each item for craftability and type
for( IAEItemStack stack : storedItems )
{
if( stack == null )
{
continue;
}
// Is the stack craftable, has NBT tag, and is a crafting aspect?
if( stack.isCraftable() && stack.hasTagCompound() && ( stack.getItem() instanceof ItemCraftingAspect ) )
{
// Get the aspect
Aspect aspect = ItemCraftingAspect.getAspect( stack.getTagCompound().getNBTTagCompoundCopy() );
if( aspect != null )
{
// Add the aspect
craftableAspects.add( aspect );
}
}
}
// Anything added?
if( craftableAspects.size() > 0 )
{
this.setCraftableAspects( craftableAspects );
}
}