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


Java ItemApi.getItem方法代码示例

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


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

示例1: render

import thaumcraft.api.ItemApi; //导入方法依赖的package包/类
@Override
public void render( EntityLivingBase entity, ItemStack stack, String modName, float par2, float par3, float par4, float par5, float par6, float par7 )
{
	TextureManager re = Minecraft.getMinecraft().getTextureManager();
	
	ItemStack harnessStack = ItemApi.getItem( "itemHoverHarness", 0 );
	Item harnessItem = harnessStack.getItem();
	
	if ( entity instanceof EntityPlayer )
	{
		EntityPlayer player = ( EntityPlayer ) entity;

		harnessStack.setTagCompound( stack.getTagCompound() );
		
		ItemStack old = player.inventory.armorInventory[ 2 ];
		player.inventory.armorInventory[ 2 ] = harnessStack;
		try
		{
			re.bindTexture( new ResourceLocation( harnessItem.getArmorTexture( harnessStack, entity, 1, "overlay" ) ) );
			harnessItem.getArmorModel( entity, harnessStack, 1 ).render( entity, 0, 0, 0, 0, 0, par7 );
		}
		finally
		{
			player.inventory.armorInventory[ 2 ] = old;
		}
	}
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:28,代码来源:HoverHarnessRenderer.java

示例2: tickEnd

import thaumcraft.api.ItemApi; //导入方法依赖的package包/类
@SubscribeEvent
public void tickEnd( RenderTickEvent event )
{
	if ( !event.phase.equals( TickEvent.Phase.END ) )
	{
		return;
	}
	Minecraft mc = FMLClientHandler.instance().getClient();
	
	if ( mc.currentScreen != null || renderObj == null || renderMethod == null )
	{
		return;
	}
	
	EntityPlayer player = mc.thePlayer;
	
	ItemStack chestplate = player.getCurrentArmor( 2 );
	if ( chestplate == null || chestplate.getItem() != ComponentEquipment.items.chestplate )
	{
		return;
	}
	ArmorItem armor = ( ArmorItem ) chestplate.getItem();
	
	if ( armor.armor.getModifierLevel( chestplate, "hoverHarness" ) <= 0 )
	{
		return;
	}
	
	ItemStack harnessStack = ItemApi.getItem( "itemHoverHarness", 0 );
	harnessStack.setTagCompound( chestplate.getTagCompound() );
	
	try
	{
		renderMethod.invoke( renderObj, ( Float ) event.renderTickTime, player, System.currentTimeMillis(), harnessStack );
	}
	catch ( Exception exception )
	{
		exception.printStackTrace();
	}
}
 
开发者ID:spacechase0,项目名称:ComponentEquipment,代码行数:41,代码来源:HarnessFuelRenderer.java

示例3: getCraftingItem

import thaumcraft.api.ItemApi; //导入方法依赖的package包/类
@Override
public ItemStack getCraftingItem() {
	return ItemApi.getItem("itemGoggles", 0);
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:5,代码来源:UpgradeThaumScanner.java

示例4: getCraftingItem

import thaumcraft.api.ItemApi; //导入方法依赖的package包/类
@Override
public ItemStack getCraftingItem() {
	return ItemApi.getItem("itemWandCastingAdept", OreDictionary.WILDCARD_VALUE);
}
 
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:5,代码来源:UpgradeWand.java


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