本文整理汇总了Java中net.minecraft.client.entity.AbstractClientPlayer.getItemInUseCount方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractClientPlayer.getItemInUseCount方法的具体用法?Java AbstractClientPlayer.getItemInUseCount怎么用?Java AbstractClientPlayer.getItemInUseCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.entity.AbstractClientPlayer
的用法示例。
在下文中一共展示了AbstractClientPlayer.getItemInUseCount方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: func_178104_a
import net.minecraft.client.entity.AbstractClientPlayer; //导入方法依赖的package包/类
private void func_178104_a(AbstractClientPlayer clientPlayer, float p_178104_2_)
{
float f = (float)clientPlayer.getItemInUseCount() - p_178104_2_ + 1.0F;
float f1 = f / (float)this.itemToRender.getMaxItemUseDuration();
float f2 = MathHelper.abs(MathHelper.cos(f / 4.0F * (float)Math.PI) * 0.1F);
if (f1 >= 0.8F)
{
f2 = 0.0F;
}
GlStateManager.translate(0.0F, f2, 0.0F);
float f3 = 1.0F - (float)Math.pow((double)f1, 27.0D);
GlStateManager.translate(f3 * 0.6F, f3 * -0.5F, f3 * 0.0F);
GlStateManager.rotate(f3 * 90.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(f3 * 10.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(f3 * 30.0F, 0.0F, 0.0F, 1.0F);
}
示例2: func_178098_a
import net.minecraft.client.entity.AbstractClientPlayer; //导入方法依赖的package包/类
private void func_178098_a(float p_178098_1_, AbstractClientPlayer clientPlayer)
{
GlStateManager.rotate(-18.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(-12.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(-8.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.translate(-0.9F, 0.2F, 0.0F);
float f = (float)this.itemToRender.getMaxItemUseDuration() - ((float)clientPlayer.getItemInUseCount() - p_178098_1_ + 1.0F);
float f1 = f / 20.0F;
f1 = (f1 * f1 + f1 * 2.0F) / 3.0F;
if (f1 > 1.0F)
{
f1 = 1.0F;
}
if (f1 > 0.1F)
{
float f2 = MathHelper.sin((f - 0.1F) * 1.3F);
float f3 = f1 - 0.1F;
float f4 = f2 * f3;
GlStateManager.translate(f4 * 0.0F, f4 * 0.01F, f4 * 0.0F);
}
GlStateManager.translate(f1 * 0.0F, f1 * 0.0F, f1 * 0.1F);
GlStateManager.scale(1.0F, 1.0F, 1.0F + f1 * 0.2F);
}
示例3: setModelVisibilities
import net.minecraft.client.entity.AbstractClientPlayer; //导入方法依赖的package包/类
private void setModelVisibilities(AbstractClientPlayer clientPlayer)
{
ModelPlayer modelplayer = this.getMainModel();
if (clientPlayer.isSpectator())
{
modelplayer.setInvisible(false);
modelplayer.bipedHead.showModel = true;
modelplayer.bipedHeadwear.showModel = true;
}
else
{
ItemStack itemstack = clientPlayer.inventory.getCurrentItem();
modelplayer.setInvisible(true);
modelplayer.bipedHeadwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.HAT);
modelplayer.bipedBodyWear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.JACKET);
modelplayer.bipedLeftLegwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.LEFT_PANTS_LEG);
modelplayer.bipedRightLegwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.RIGHT_PANTS_LEG);
modelplayer.bipedLeftArmwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.LEFT_SLEEVE);
modelplayer.bipedRightArmwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.RIGHT_SLEEVE);
modelplayer.heldItemLeft = 0;
modelplayer.aimedBow = false;
modelplayer.isSneak = clientPlayer.isSneaking();
if (itemstack == null)
{
modelplayer.heldItemRight = 0;
}
else
{
modelplayer.heldItemRight = 1;
if (clientPlayer.getItemInUseCount() > 0)
{
EnumAction enumaction = itemstack.getItemUseAction();
if (enumaction == EnumAction.BLOCK)
{
modelplayer.heldItemRight = 3;
}
else if (enumaction == EnumAction.BOW)
{
modelplayer.aimedBow = true;
}
}
}
}
}
示例4: renderItemInFirstPerson
import net.minecraft.client.entity.AbstractClientPlayer; //导入方法依赖的package包/类
/**
* Renders the active item in the player's hand when in first person mode. Args: partialTickTime
*/
public void renderItemInFirstPerson(float partialTicks)
{
float f = 1.0F - (this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * partialTicks);
AbstractClientPlayer abstractclientplayer = this.mc.thePlayer;
float f1 = abstractclientplayer.getSwingProgress(partialTicks);
float f2 = abstractclientplayer.prevRotationPitch + (abstractclientplayer.rotationPitch - abstractclientplayer.prevRotationPitch) * partialTicks;
float f3 = abstractclientplayer.prevRotationYaw + (abstractclientplayer.rotationYaw - abstractclientplayer.prevRotationYaw) * partialTicks;
this.func_178101_a(f2, f3);
this.func_178109_a(abstractclientplayer);
this.func_178110_a((EntityPlayerSP)abstractclientplayer, partialTicks);
GlStateManager.enableRescaleNormal();
GlStateManager.pushMatrix();
if (this.itemToRender != null)
{
if (this.itemToRender.getItem() == Items.filled_map)
{
this.renderItemMap(abstractclientplayer, f2, f, f1);
}
else if (abstractclientplayer.getItemInUseCount() > 0)
{
EnumAction enumaction = this.itemToRender.getItemUseAction();
switch (enumaction)
{
case NONE:
this.transformFirstPersonItem(f, 0.0F);
break;
case EAT:
case DRINK:
this.func_178104_a(abstractclientplayer, partialTicks);
this.transformFirstPersonItem(f, 0.0F);
break;
case BLOCK:
this.transformFirstPersonItem(f, 0.0F);
this.func_178103_d();
break;
case BOW:
this.transformFirstPersonItem(f, 0.0F);
this.func_178098_a(partialTicks, abstractclientplayer);
}
}
else
{
this.func_178105_d(f1);
this.transformFirstPersonItem(f, f1);
}
this.renderItem(abstractclientplayer, this.itemToRender, ItemCameraTransforms.TransformType.FIRST_PERSON);
}
else if (!abstractclientplayer.isInvisible())
{
this.func_178095_a(abstractclientplayer, f, f1);
}
GlStateManager.popMatrix();
GlStateManager.disableRescaleNormal();
RenderHelper.disableStandardItemLighting();
}
示例5: setModelVisibilities
import net.minecraft.client.entity.AbstractClientPlayer; //导入方法依赖的package包/类
private void setModelVisibilities(AbstractClientPlayer clientPlayer)
{
ModelPlayer modelplayer = this.getMainModel();
if (clientPlayer.isSpectator())
{
modelplayer.setInvisible(false);
modelplayer.bipedHead.showModel = true;
modelplayer.bipedHeadwear.showModel = true;
}
else
{
ItemStack itemstack = clientPlayer.getHeldItemMainhand();
ItemStack itemstack1 = clientPlayer.getHeldItemOffhand();
modelplayer.setInvisible(true);
modelplayer.bipedHeadwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.HAT);
modelplayer.bipedBodyWear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.JACKET);
modelplayer.bipedLeftLegwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.LEFT_PANTS_LEG);
modelplayer.bipedRightLegwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.RIGHT_PANTS_LEG);
modelplayer.bipedLeftArmwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.LEFT_SLEEVE);
modelplayer.bipedRightArmwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.RIGHT_SLEEVE);
modelplayer.isSneak = clientPlayer.isSneaking();
ModelBiped.ArmPose modelbiped$armpose = ModelBiped.ArmPose.EMPTY;
ModelBiped.ArmPose modelbiped$armpose1 = ModelBiped.ArmPose.EMPTY;
if (!itemstack.func_190926_b())
{
modelbiped$armpose = ModelBiped.ArmPose.ITEM;
if (clientPlayer.getItemInUseCount() > 0)
{
EnumAction enumaction = itemstack.getItemUseAction();
if (enumaction == EnumAction.BLOCK)
{
modelbiped$armpose = ModelBiped.ArmPose.BLOCK;
}
else if (enumaction == EnumAction.BOW)
{
modelbiped$armpose = ModelBiped.ArmPose.BOW_AND_ARROW;
}
}
}
if (!itemstack1.func_190926_b())
{
modelbiped$armpose1 = ModelBiped.ArmPose.ITEM;
if (clientPlayer.getItemInUseCount() > 0)
{
EnumAction enumaction1 = itemstack1.getItemUseAction();
if (enumaction1 == EnumAction.BLOCK)
{
modelbiped$armpose1 = ModelBiped.ArmPose.BLOCK;
}
}
}
if (clientPlayer.getPrimaryHand() == EnumHandSide.RIGHT)
{
modelplayer.rightArmPose = modelbiped$armpose;
modelplayer.leftArmPose = modelbiped$armpose1;
}
else
{
modelplayer.rightArmPose = modelbiped$armpose1;
modelplayer.leftArmPose = modelbiped$armpose;
}
}
}
示例6: setModelVisibilities
import net.minecraft.client.entity.AbstractClientPlayer; //导入方法依赖的package包/类
private void setModelVisibilities(AbstractClientPlayer clientPlayer)
{
ModelPlayer modelplayer = this.getMainModel();
if (clientPlayer.isSpectator())
{
modelplayer.setInvisible(false);
modelplayer.bipedHead.showModel = true;
modelplayer.bipedHeadwear.showModel = true;
}
else
{
ItemStack itemstack = clientPlayer.getHeldItemMainhand();
ItemStack itemstack1 = clientPlayer.getHeldItemOffhand();
modelplayer.setInvisible(true);
modelplayer.bipedHeadwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.HAT);
modelplayer.bipedBodyWear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.JACKET);
modelplayer.bipedLeftLegwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.LEFT_PANTS_LEG);
modelplayer.bipedRightLegwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.RIGHT_PANTS_LEG);
modelplayer.bipedLeftArmwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.LEFT_SLEEVE);
modelplayer.bipedRightArmwear.showModel = clientPlayer.isWearing(EnumPlayerModelParts.RIGHT_SLEEVE);
modelplayer.isSneak = clientPlayer.isSneaking();
ModelBiped.ArmPose modelbiped$armpose = ModelBiped.ArmPose.EMPTY;
ModelBiped.ArmPose modelbiped$armpose1 = ModelBiped.ArmPose.EMPTY;
if (itemstack != null)
{
modelbiped$armpose = ModelBiped.ArmPose.ITEM;
if (clientPlayer.getItemInUseCount() > 0)
{
EnumAction enumaction = itemstack.getItemUseAction();
if (enumaction == EnumAction.BLOCK)
{
modelbiped$armpose = ModelBiped.ArmPose.BLOCK;
}
else if (enumaction == EnumAction.BOW)
{
modelbiped$armpose = ModelBiped.ArmPose.BOW_AND_ARROW;
}
}
}
if (itemstack1 != null)
{
modelbiped$armpose1 = ModelBiped.ArmPose.ITEM;
if (clientPlayer.getItemInUseCount() > 0)
{
EnumAction enumaction1 = itemstack1.getItemUseAction();
if (enumaction1 == EnumAction.BLOCK)
{
modelbiped$armpose1 = ModelBiped.ArmPose.BLOCK;
}
// FORGE: fix MC-88356 allow offhand to use bow and arrow animation
else if (enumaction1 == EnumAction.BOW)
{
modelbiped$armpose1 = ModelBiped.ArmPose.BOW_AND_ARROW;
}
}
}
if (clientPlayer.getPrimaryHand() == EnumHandSide.RIGHT)
{
modelplayer.rightArmPose = modelbiped$armpose;
modelplayer.leftArmPose = modelbiped$armpose1;
}
else
{
modelplayer.rightArmPose = modelbiped$armpose1;
modelplayer.leftArmPose = modelbiped$armpose;
}
}
}