本文整理匯總了Java中net.minecraft.client.entity.AbstractClientPlayer.getSwingProgress方法的典型用法代碼示例。如果您正苦於以下問題:Java AbstractClientPlayer.getSwingProgress方法的具體用法?Java AbstractClientPlayer.getSwingProgress怎麽用?Java AbstractClientPlayer.getSwingProgress使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.entity.AbstractClientPlayer
的用法示例。
在下文中一共展示了AbstractClientPlayer.getSwingProgress方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: renderExtra
import net.minecraft.client.entity.AbstractClientPlayer; //導入方法依賴的package包/類
private static void renderExtra(float partialTicks) {
AbstractClientPlayer abstractclientplayer = Minecraft.getMinecraft().player;
float f = abstractclientplayer.getSwingProgress(partialTicks);
EnumHand enumhand = (EnumHand) MoreObjects.firstNonNull(abstractclientplayer.swingingHand, EnumHand.MAIN_HAND);
float f1 = abstractclientplayer.prevRotationPitch
+ (abstractclientplayer.rotationPitch - abstractclientplayer.prevRotationPitch) * partialTicks;
float f2 = abstractclientplayer.prevRotationYaw
+ (abstractclientplayer.rotationYaw - abstractclientplayer.prevRotationYaw) * partialTicks;
rotateArroundXAndY(f1, f2);
setLightmap();
rotateArm(partialTicks);
GlStateManager.enableRescaleNormal();
float f3 = enumhand == EnumHand.MAIN_HAND ? f : 0.0F;
float f5 = 1.0F - (1F);
renderArmsFirstPerson(f1, f5, f3);
//float f4 = enumhand == EnumHand.OFF_HAND ? f : 0.0F;
//float f6 = 1.0F - (0F);
//renderArmsFirstPerson(f1, f6, f4);
GlStateManager.disableRescaleNormal();
}
示例2: 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();
}
示例3: renderItemInFirstPerson
import net.minecraft.client.entity.AbstractClientPlayer; //導入方法依賴的package包/類
/**
* Renders the active item in the player's hand when in first person mode.
*/
public void renderItemInFirstPerson(float partialTicks)
{
AbstractClientPlayer abstractclientplayer = this.mc.player;
float f = abstractclientplayer.getSwingProgress(partialTicks);
EnumHand enumhand = (EnumHand)Objects.firstNonNull(abstractclientplayer.swingingHand, EnumHand.MAIN_HAND);
float f1 = abstractclientplayer.prevRotationPitch + (abstractclientplayer.rotationPitch - abstractclientplayer.prevRotationPitch) * partialTicks;
float f2 = abstractclientplayer.prevRotationYaw + (abstractclientplayer.rotationYaw - abstractclientplayer.prevRotationYaw) * partialTicks;
boolean flag = true;
boolean flag1 = true;
if (abstractclientplayer.isHandActive())
{
ItemStack itemstack = abstractclientplayer.getActiveItemStack();
if (itemstack != null && itemstack.getItem() == Items.BOW)
{
EnumHand enumhand1 = abstractclientplayer.getActiveHand();
flag = enumhand1 == EnumHand.MAIN_HAND;
flag1 = !flag;
}
}
this.rotateArroundXAndY(f1, f2);
this.setLightmap();
this.rotateArm(partialTicks);
GlStateManager.enableRescaleNormal();
if (flag)
{
float f3 = enumhand == EnumHand.MAIN_HAND ? f : 0.0F;
float f5 = 1.0F - (this.prevEquippedProgressMainHand + (this.equippedProgressMainHand - this.prevEquippedProgressMainHand) * partialTicks);
if (!Reflector.ForgeHooksClient_renderSpecificFirstPersonHand.exists() || !Reflector.callBoolean(Reflector.ForgeHooksClient_renderSpecificFirstPersonHand, new Object[] {EnumHand.MAIN_HAND, Float.valueOf(partialTicks), Float.valueOf(f1), Float.valueOf(f3), Float.valueOf(f5), this.itemStackMainHand}))
{
this.renderItemInFirstPerson(abstractclientplayer, partialTicks, f1, EnumHand.MAIN_HAND, f3, this.itemStackMainHand, f5);
}
}
if (flag1)
{
float f4 = enumhand == EnumHand.OFF_HAND ? f : 0.0F;
float f6 = 1.0F - (this.prevEquippedProgressOffHand + (this.equippedProgressOffHand - this.prevEquippedProgressOffHand) * partialTicks);
if (!Reflector.ForgeHooksClient_renderSpecificFirstPersonHand.exists() || !Reflector.callBoolean(Reflector.ForgeHooksClient_renderSpecificFirstPersonHand, new Object[] {EnumHand.OFF_HAND, Float.valueOf(partialTicks), Float.valueOf(f1), Float.valueOf(f4), Float.valueOf(f6), this.itemStackOffHand}))
{
this.renderItemInFirstPerson(abstractclientplayer, partialTicks, f1, EnumHand.OFF_HAND, f4, this.itemStackOffHand, f6);
}
}
GlStateManager.disableRescaleNormal();
RenderHelper.disableStandardItemLighting();
}
示例4: renderItemInFirstPerson
import net.minecraft.client.entity.AbstractClientPlayer; //導入方法依賴的package包/類
/**
* Renders the active item in the player's hand when in first person mode.
*/
public void renderItemInFirstPerson(float partialTicks)
{
AbstractClientPlayer abstractclientplayer = this.mc.thePlayer;
float f = abstractclientplayer.getSwingProgress(partialTicks);
EnumHand enumhand = (EnumHand)Objects.firstNonNull(abstractclientplayer.swingingHand, EnumHand.MAIN_HAND);
float f1 = abstractclientplayer.prevRotationPitch + (abstractclientplayer.rotationPitch - abstractclientplayer.prevRotationPitch) * partialTicks;
float f2 = abstractclientplayer.prevRotationYaw + (abstractclientplayer.rotationYaw - abstractclientplayer.prevRotationYaw) * partialTicks;
boolean flag = true;
boolean flag1 = true;
if (abstractclientplayer.isHandActive())
{
ItemStack itemstack = abstractclientplayer.getActiveItemStack();
if (itemstack != null && itemstack.getItem() == Items.BOW) //Forge: Data watcher can desync and cause this to NPE...
{
EnumHand enumhand1 = abstractclientplayer.getActiveHand();
flag = enumhand1 == EnumHand.MAIN_HAND;
flag1 = !flag;
}
}
this.rotateArroundXAndY(f1, f2);
this.setLightmap();
this.rotateArm(partialTicks);
GlStateManager.enableRescaleNormal();
if (flag)
{
float f3 = enumhand == EnumHand.MAIN_HAND ? f : 0.0F;
float f5 = 1.0F - (this.prevEquippedProgressMainHand + (this.equippedProgressMainHand - this.prevEquippedProgressMainHand) * partialTicks);
if(!net.minecraftforge.client.ForgeHooksClient.renderSpecificFirstPersonHand(EnumHand.MAIN_HAND, partialTicks, f1, f3, f5, this.itemStackMainHand))
this.renderItemInFirstPerson(abstractclientplayer, partialTicks, f1, EnumHand.MAIN_HAND, f3, this.itemStackMainHand, f5);
}
if (flag1)
{
float f4 = enumhand == EnumHand.OFF_HAND ? f : 0.0F;
float f6 = 1.0F - (this.prevEquippedProgressOffHand + (this.equippedProgressOffHand - this.prevEquippedProgressOffHand) * partialTicks);
if(!net.minecraftforge.client.ForgeHooksClient.renderSpecificFirstPersonHand(EnumHand.OFF_HAND, partialTicks, f1, f4, f6, this.itemStackOffHand))
this.renderItemInFirstPerson(abstractclientplayer, partialTicks, f1, EnumHand.OFF_HAND, f4, this.itemStackOffHand, f6);
}
GlStateManager.disableRescaleNormal();
RenderHelper.disableStandardItemLighting();
}