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


Java ThaumcraftApiHelper.getObjectAspects方法代码示例

本文整理汇总了Java中thaumcraft.api.ThaumcraftApiHelper.getObjectAspects方法的典型用法代码示例。如果您正苦于以下问题:Java ThaumcraftApiHelper.getObjectAspects方法的具体用法?Java ThaumcraftApiHelper.getObjectAspects怎么用?Java ThaumcraftApiHelper.getObjectAspects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在thaumcraft.api.ThaumcraftApiHelper的用法示例。


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

示例1: addInfusedOreAspect

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
/** Add aspects to infused ore */
private static void addInfusedOreAspect(BlockInfusedBlockOre ore, Aspect aspect, int... metas) {
	Block baseBlock = ore.getBaseBlock();
	int baseMeta = ore.getBaseMeta();
	AspectList baseAspects = ThaumcraftApiHelper.getObjectAspects(new ItemStack(baseBlock, 1, baseMeta));
	AspectList oreAspects = new AspectList().add(aspect, TOConfig.generalAspectCount);
	oreAspects.add(baseAspects);
	ThaumcraftApi.registerObjectTag(new ItemStack(ore), metas, oreAspects);
}
 
开发者ID:MJaroslav,项目名称:ThaumOres,代码行数:10,代码来源:TOThaum.java

示例2: AspectList

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
/**
 * this creates a new aspect list with preloaded values based off the aspects of the given item.
 * 
 * @param the
 *        itemstack of the given item
 */
public AspectList(ItemStack stack) {
	try {
		AspectList temp = ThaumcraftApiHelper.getObjectAspects(stack);
		if (temp != null) {
			for (Aspect tag : temp.getAspects()) {
				add(tag, temp.getAmount(tag));
			}
		}
	}
	catch (Exception e) {}
}
 
开发者ID:PrincessRTFM,项目名称:TweakCraft,代码行数:18,代码来源:AspectList.java

示例3: AspectList

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
/**
 * this creates a new aspect list with preloaded values based off the aspects of the given item.
 * @param the itemstack of the given item
 */
public AspectList(ItemStack stack) {
	try {
		AspectList temp = ThaumcraftApiHelper.getObjectAspects(stack);
		if (temp!=null)
		for (Aspect tag:temp.getAspects()) {
			add(tag,temp.getAmount(tag));
		}
	} catch (Exception e) {}
}
 
开发者ID:Brandomine,项目名称:Augury,代码行数:14,代码来源:AspectList.java

示例4: AspectList

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
/**
 * this creates a new aspect list with preloaded values based off the aspects of the given item.
 */
public AspectList(ItemStack stack)
{
    try
    {
        AspectList temp = ThaumcraftApiHelper.getObjectAspects(stack);
        if(temp != null) for(Aspect tag : temp.getAspects())
        {
            add(tag, temp.getAmount(tag));
        }
    }
    catch(Exception e){}
}
 
开发者ID:J3FF97,项目名称:Steel-Industries,代码行数:16,代码来源:AspectList.java

示例5: AspectList

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
/**
 * this creates a new aspect list with preloaded values based off the aspects of the given item.
 * @param stack itemstack of the given item
 */
public AspectList(ItemStack stack) {
	try {
		AspectList temp = ThaumcraftApiHelper.getObjectAspects(stack);
		if (temp!=null)
		for (Aspect tag:temp.getAspects()) {
			add(tag,temp.getAmount(tag));
		}
	} catch (Exception e) {}
}
 
开发者ID:goldenapple3,项目名称:CopperTools,代码行数:14,代码来源:AspectList.java

示例6: AspectList

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
/**
 * this creates a new aspect list with preloaded values based off the aspects of the given item.
 * @param the itemstack of the given item
 */
public AspectList(ItemStack stack) {
    try {
        AspectList temp = ThaumcraftApiHelper.getObjectAspects(stack);
        if (temp != null) {
            for (Aspect tag : temp.getAspects()) {
                add(tag, temp.getAmount(tag));
            }
        }
    } catch (Exception e) {
    }
}
 
开发者ID:AgileMods,项目名称:MateriaMuto,代码行数:16,代码来源:AspectList.java

示例7: AspectList

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
/**
 * this creates a new aspect list with preloaded values based off the
 * aspects of the given item.
 * 
 * @param the
 *            itemstack of the given item
 */
public AspectList(ItemStack stack) {
	try {
		AspectList temp = ThaumcraftApiHelper.getObjectAspects(stack);
		if (temp != null)
			for (Aspect tag : temp.getAspects()) {
				add(tag, temp.getAmount(tag));
			}
	} catch (Exception e) {
	}
}
 
开发者ID:jaredlll08,项目名称:MysticalTrinkets,代码行数:18,代码来源:AspectList.java

示例8: handleQEDRecipes_do

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
private static void handleQEDRecipes_do(final ArrayList<ItemStack> items) {
    for (final ItemStack item : items) {
        ThaumcraftApiHelper.getObjectAspects(item);
    }
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:6,代码来源:ThaumcraftHelper.java

示例9: findAspectsForIngredients

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
/**
 * Builds the aspect list from the items ingredients.
 *
 * @param itemInfo
 */
private void findAspectsForIngredients()
{
	for( ItemStack stack : this.ingredients )
	{
		// Get the aspects for the stack
		AspectList stackAspects = ThaumcraftApiHelper.getObjectAspects( stack );

		// Are there no aspects for this item?
		if( ( stackAspects == null ) || ( stackAspects.size() == 0 ) )
		{
			// Is the item an AE item?
			AEItemInfo ingInfo = AEAspectRegister.this.getInfoForDefinitionOrStack( stack );

			if( ingInfo != null )
			{
				// Ensure the item is not in the dependency chain.
				if( !AEAspectRegister.this.DEPENDENCY_CHAIN.contains( ingInfo ) )
				{
					// Register the item
					ingInfo.registerItem( this.pass );

					// Attempt to get the aspects again
					stackAspects = ThaumcraftApiHelper.getObjectAspects( stack );
				}
			}
		}

		// Are there still no aspects to add?
		if( ( stackAspects == null ) || ( stackAspects.size() == 0 ) )
		{
			continue;
		}

		// Assign each aspect
		for( Aspect currentStackAspect : stackAspects.getAspects() )
		{
			// Get the current amount
			int existingAmount = this.ingredientAspects.getAmount( currentStackAspect );

			// Get the ingredient amount
			int ingredientAspectAmount = stackAspects.getAmount( currentStackAspect );

			// Merge
			if( existingAmount < ingredientAspectAmount )
			{
				this.ingredientAspects.add( currentStackAspect, ( ingredientAspectAmount - existingAmount ) );
			}
		}
	}
}
 
开发者ID:Nividica,项目名称:ThaumicEnergistics,代码行数:56,代码来源:AEAspectRegister.java

示例10: registerThEItems

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
/**
 * Updates the aspects for the thaumic energistics items.
 */
private void registerThEItems()
{
	IThEItems teItems = ThEApi.instance().items();
	thaumicenergistics.api.IThEBlocks teBlocks = ThEApi.instance().blocks();

	// Get an AE 1K Cell
	ItemStack aeCell = AEApi.instance().definitions().items().cell1k().maybeStack( 1 ).orNull();
	AspectList cellAspects = null;
	if( aeCell != null )
	{
		// Get the aspect list for a 1k cell
		AspectList aeCellAspects = ThaumcraftApiHelper.getObjectAspects( aeCell );
		if( aeCellAspects != null )
		{
			// Copy the aspects
			cellAspects = aeCellAspects.copy();
			int aspectCount = cellAspects.size();

			// Is there too many aspects?
			if( aspectCount > 4 )
			{
				Aspect[] OrderedAspects = cellAspects.getAspectsSortedAmount();

				// Remove lowest
				cellAspects.remove( OrderedAspects[aspectCount - 1] );

				// Still not enough room?
				if( aspectCount > 5 )
				{

					// Remove lowest
					cellAspects.remove( OrderedAspects[aspectCount - 2] );
				}
			}

			// Add magic and aura
			cellAspects.add( Aspect.MAGIC, 3 );
			cellAspects.add( Aspect.AURA, 5 );
			ThaumcraftApi.registerObjectTag( teItems.EssentiaCell_1k.getStack(), cellAspects );
			ThaumcraftApi.registerObjectTag( teItems.EssentiaCell_4k.getStack(), cellAspects );
			ThaumcraftApi.registerObjectTag( teItems.EssentiaCell_16k.getStack(), cellAspects );
			ThaumcraftApi.registerObjectTag( teItems.EssentiaCell_64k.getStack(), cellAspects );
		}
	}

	// Were the cells registered?
	if( ( aeCell == null ) || ( cellAspects == null ) )
	{
		ThELog.info( "Could not register \"%s\" for TC scanning.", "Essentia Cells" );
	}

	// Set the aspects for the iron gearbox
	AspectList ironGearboxAspects = new AspectList();
	ironGearboxAspects.add( Aspect.METAL, 7 );
	ironGearboxAspects.add( Aspect.MECHANISM, 5 );
	ironGearboxAspects.add( Aspect.EARTH, 2 );
	ironGearboxAspects.add( Aspect.ENTROPY, 2 );
	ThaumcraftApi.registerObjectTag( teBlocks.IronGearBox.getStack(), ironGearboxAspects );

	// Set the aspects for the thaumium gearbox
	AspectList thaumGearbox = ironGearboxAspects.copy();
	thaumGearbox.add( Aspect.MAGIC, 10 );
	thaumGearbox.add( Aspect.MECHANISM, 5 );
	thaumGearbox.add( Aspect.METAL, 3 );
	ThaumcraftApi.registerObjectTag( teBlocks.ThaumiumGearBox.getStack(), thaumGearbox );

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

示例11: scanSourceItem

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
/**
 * Called when the source item has changed.
 *
 * @param setSelectedAspect
 */
private void scanSourceItem( final boolean setSelectedAspect )
{

	this.cachedSource = this.slotSourceItem.getStack();

	// Clear aspect slots
	this.clearAspectSlots();

	// Null?
	if( this.cachedSource == null )
	{
		// Done
		return;
	}

	// Get the aspects
	AspectList itemAspects = ThaumcraftApiHelper.getObjectAspects( this.cachedSource );
	Aspect[] sortedAspects = null;

	// Does the item have any aspects?
	if( ( itemAspects == null ) || ( itemAspects.size() == 0 ) )
	{
		// Done
		return;
	}

	// Generate hash
	int hash = ScanManager.generateItemHash( this.cachedSource.getItem(), this.cachedSource.getItemDamage() );

	// Get the list of scanned objects
	List<String> list = Thaumcraft.proxy.getScannedObjects().get( this.player.getCommandSenderName() );

	// Assume all slot will have an aspect
	int numOfAspects = this.slotSourceAspects.length;

	// Has the player scanned the item?
	boolean playerScanned = ( ( list != null ) && ( ( list.contains( "@" + hash ) ) || ( list.contains( "#" + hash ) ) ) );
	if( playerScanned )
	{
		// Get sorted
		sortedAspects = itemAspects.getAspectsSortedAmount();

		// Set number to display
		numOfAspects = Math.min( numOfAspects, sortedAspects.length );
	}

	// Add each aspect
	Aspect aspect;
	for( int i = 0; i < numOfAspects; ++i )
	{
		// Create an itemstack
		ItemStack aspectItem = ItemEnum.CRAFTING_ASPECT.getStack();

		if( sortedAspects != null )
		{
			// Get the aspect
			aspect = sortedAspects[i];

			// Set the aspect
			ItemCraftingAspect.setAspect( aspectItem, aspect );

			// Set the size
			aspectItem.stackSize = itemAspects.getAmount( aspect );
		}

		// Put into slot
		this.slotSourceAspects[i].putStack( aspectItem );

		// Selected aspect empty?
		if( setSelectedAspect && playerScanned && !this.slotSelectedAspect.getHasStack() )
		{
			// Set selected
			this.setSelectedAspect( aspectItem );
		}
	}
}
 
开发者ID:Nividica,项目名称:ThaumicEnergistics,代码行数:82,代码来源:ContainerDistillationPatternEncoder.java

示例12: getAspectList

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
private static AspectList getAspectList(ItemStack stack) {
    AspectList list = ThaumcraftApiHelper.getObjectAspects(stack);
    return list != null ? list : new AspectList();
}
 
开发者ID:SpitefulFox,项目名称:ForbiddenMagic,代码行数:5,代码来源:DarkAspects.java


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