本文整理汇总了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;
}
}
}
示例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();
}
}
示例3: getCraftingItem
import thaumcraft.api.ItemApi; //导入方法依赖的package包/类
@Override
public ItemStack getCraftingItem() {
return ItemApi.getItem("itemGoggles", 0);
}
示例4: getCraftingItem
import thaumcraft.api.ItemApi; //导入方法依赖的package包/类
@Override
public ItemStack getCraftingItem() {
return ItemApi.getItem("itemWandCastingAdept", OreDictionary.WILDCARD_VALUE);
}