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


Java EntityPlayer.getItemInUse方法代码示例

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


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

示例1: getIcon

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
   public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) 
{
	if(player.getItemInUse() == null) { return this.itemIcon; }
        
        int Pulling = stack.getMaxItemUseDuration() - useRemaining;	// Displaying the bow drawing animation based on the use state
       
        if (Pulling >= 18) { return this.pull_2; }
        else if (Pulling > 13) { return this.pull_1; }
        else if (Pulling > 0) { return this.pull_0; }              
        
        return itemIcon;
   }
 
开发者ID:Domochevsky,项目名称:minecraft-quiverbow,代码行数:14,代码来源:EnderBow.java

示例2: getIcon

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) 	// On hand display
{
	if(player.getItemInUse() == null) { return this.itemIcon; }

	int Pulling = stack.getMaxItemUseDuration() - useRemaining;	// Displaying the bow drawing animation based on the use state

	if (Pulling >= 18) { return this.pull_2; }
	else if (Pulling > 13) { return this.pull_1; }
	else if (Pulling > 0) { return this.pull_0; }

	return this.itemIcon;
}
 
开发者ID:Domochevsky,项目名称:minecraft-quiverbow,代码行数:14,代码来源:QuiverBow.java

示例3: renderItem

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
public void renderItem(ItemRenderType type, ItemStack stack, Object... data) {
	TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();
	ResourceLocation resource = textureManager.getResourceLocation(stack.getItemSpriteNumber());

	EntityPlayer player = Minecraft.getMinecraft().thePlayer;
	ItemStack usingItem = player.getItemInUse();
	int useRemaining = player.getItemInUseCount();

	ItemBow bow = (ItemBow) stack.getItem();

	IIcon icon = bow.getIcon(stack, 0);
	if (usingItem != null && usingItem == stack) {
		int charge = stack.getMaxItemUseDuration() - useRemaining;
		if (charge >= 18)
			icon = bow.getItemIconForUseDuration(2);
		else if (charge > 13)
			icon = bow.getItemIconForUseDuration(1);
		else if (charge > 0)
			icon = bow.getItemIconForUseDuration(0);
	}
	if (icon == null)
		icon = ((TextureMap) textureManager.getTexture(resource)).getAtlasSprite("missingno");

	OpenGLHelper.pushMatrix();
	textureManager.bindTexture(resource);

	OpenGLHelper.colour(bow.getColorFromItemStack(stack, 0));

	OpenGLHelper.disableLighting();
	OpenGLHelper.enableAlpha();
	OpenGLHelper.enableBlend();
	OpenGlHelper.glBlendFunc(770, 771, 1, 0);

	renderItem.renderIcon(0, 0, icon, 16, 16);

	OpenGLHelper.enableLighting();
	OpenGLHelper.disableAlpha();
	OpenGLHelper.disableBlend();

	if (stack.hasEffect(0))
		renderItem.renderEffect(textureManager, 0, 0);

	OpenGLHelper.popMatrix();
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:46,代码来源:ItemBowRenderer.java


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