本文整理匯總了Java中net.minecraft.util.EnumHandSide類的典型用法代碼示例。如果您正苦於以下問題:Java EnumHandSide類的具體用法?Java EnumHandSide怎麽用?Java EnumHandSide使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
EnumHandSide類屬於net.minecraft.util包,在下文中一共展示了EnumHandSide類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: doRenderLayer
import net.minecraft.util.EnumHandSide; //導入依賴的package包/類
public void doRenderLayer(EntityObj entityObj, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
boolean flag = entityObj.getPrimaryHand() == EnumHandSide.RIGHT;
ItemStack itemstack = flag ? entityObj.getHeldItemOffhand() : entityObj.getHeldItemMainhand();
ItemStack itemstack1 = flag ? entityObj.getHeldItemMainhand() : entityObj.getHeldItemOffhand();
if (!itemstack.isEmpty() || !itemstack1.isEmpty())
{
GL11.glPushMatrix();
//Basic model fixes
GL11.glRotatef(ModelObj.initRotFix, 1.0F, 0.0F, 0.0F);
GL11.glTranslatef(0.0F, ModelObj.offsetFixY, 0.0F);
this.renderHeldItem(entityObj, itemstack1, ItemCameraTransforms.TransformType.THIRD_PERSON_RIGHT_HAND, EnumHandSide.RIGHT);
this.renderHeldItem(entityObj, itemstack, ItemCameraTransforms.TransformType.THIRD_PERSON_LEFT_HAND, EnumHandSide.LEFT);
GL11.glPopMatrix();
}
}
示例2: renderHeldItem
import net.minecraft.util.EnumHandSide; //導入依賴的package包/類
private void renderHeldItem(EntityObj entityObj, ItemStack itemStack, ItemCameraTransforms.TransformType cameraTransforms, EnumHandSide handSide)
{
if (!itemStack.isEmpty())
{
GlStateManager.pushMatrix();
if (entityObj.isSneaking())
{
GlStateManager.translate(0.0F, 0.2F, 0.0F);
}
objRenderer.transformToHandAndRotateAndScale(handSide);
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(-180.0F, 0.0F, 1.0F, 0.0F);
boolean flag = handSide == EnumHandSide.LEFT;
Minecraft.getMinecraft().getItemRenderer().renderItemSide(entityObj, itemStack, cameraTransforms, flag);
GlStateManager.popMatrix();
}
}
示例3: renderArm
import net.minecraft.util.EnumHandSide; //導入依賴的package包/類
private static void renderArm(EnumHandSide p_187455_1_) {
Minecraft mc = Minecraft.getMinecraft();
mc.getTextureManager().bindTexture(mc.player.getLocationSkin());
Render<AbstractClientPlayer> render = mc.getRenderManager()
.<AbstractClientPlayer>getEntityRenderObject(mc.player);
RenderPlayer renderplayer = (RenderPlayer) render;
GlStateManager.pushMatrix();
float f = p_187455_1_ == EnumHandSide.RIGHT ? 1.0F : -1.0F;
GlStateManager.rotate(92.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(45.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(f * -41.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.translate(f * 0.3F, -1.1F, 0.45F);
if (p_187455_1_ == EnumHandSide.RIGHT) {
renderplayer.renderRightArm(mc.player);
} else {
renderplayer.renderLeftArm(mc.player);
}
GlStateManager.popMatrix();
}
示例4: renderHeldItem
import net.minecraft.util.EnumHandSide; //導入依賴的package包/類
private void renderHeldItem(EntityLivingBase player, ItemStack stack, ItemCameraTransforms.TransformType cameraTransform, EnumHandSide handSide)
{
if (stack.isEmpty())
return;
GlStateManager.pushMatrix();
if (handSide == EnumHandSide.LEFT)
GlStateManager.translate(-4.35f / 16.0F, 0.7f, -0.1f);
else
GlStateManager.translate(4.35f / 16.0F, 0.7f, -0.1f);
GlStateManager.rotate(40.0F, 1.0F, 0.0F, 0.0F);
float scale = Config.beltItemScale;
GlStateManager.scale(scale,scale,scale);
Minecraft.getMinecraft().getItemRenderer().renderItemSide(player, stack, cameraTransform, handSide == EnumHandSide.LEFT);
GlStateManager.popMatrix();
}
示例5: doRenderLayer
import net.minecraft.util.EnumHandSide; //導入依賴的package包/類
public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
boolean flag = entitylivingbaseIn.getPrimaryHand() == EnumHandSide.RIGHT;
ItemStack itemstack = flag ? entitylivingbaseIn.getHeldItemOffhand() : entitylivingbaseIn.getHeldItemMainhand();
ItemStack itemstack1 = flag ? entitylivingbaseIn.getHeldItemMainhand() : entitylivingbaseIn.getHeldItemOffhand();
if (!itemstack.func_190926_b() || !itemstack1.func_190926_b())
{
GlStateManager.pushMatrix();
if (this.livingEntityRenderer.getMainModel().isChild)
{
float f = 0.5F;
GlStateManager.translate(0.0F, 0.75F, 0.0F);
GlStateManager.scale(0.5F, 0.5F, 0.5F);
}
this.renderHeldItem(entitylivingbaseIn, itemstack1, ItemCameraTransforms.TransformType.THIRD_PERSON_RIGHT_HAND, EnumHandSide.RIGHT);
this.renderHeldItem(entitylivingbaseIn, itemstack, ItemCameraTransforms.TransformType.THIRD_PERSON_LEFT_HAND, EnumHandSide.LEFT);
GlStateManager.popMatrix();
}
}
示例6: renderHeldItem
import net.minecraft.util.EnumHandSide; //導入依賴的package包/類
private void renderHeldItem(EntityLivingBase p_188358_1_, ItemStack p_188358_2_, ItemCameraTransforms.TransformType p_188358_3_, EnumHandSide handSide)
{
if (!p_188358_2_.func_190926_b())
{
GlStateManager.pushMatrix();
this.func_191361_a(handSide);
if (p_188358_1_.isSneaking())
{
GlStateManager.translate(0.0F, 0.2F, 0.0F);
}
GlStateManager.rotate(-90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
boolean flag = handSide == EnumHandSide.LEFT;
GlStateManager.translate((float)(flag ? -1 : 1) / 16.0F, 0.125F, -0.625F);
Minecraft.getMinecraft().getItemRenderer().renderItemSide(p_188358_1_, p_188358_2_, p_188358_3_, flag);
GlStateManager.popMatrix();
}
}
示例7: RenderVindicator
import net.minecraft.util.EnumHandSide; //導入依賴的package包/類
public RenderVindicator(RenderManager p_i47189_1_)
{
super(p_i47189_1_, new ModelVindicator(0.0F), 0.5F);
this.addLayer(new LayerHeldItem(this)
{
public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
if (((EntityVindicator)entitylivingbaseIn).func_190639_o())
{
super.doRenderLayer(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale);
}
}
protected void func_191361_a(EnumHandSide p_191361_1_)
{
((ModelIllager)this.livingEntityRenderer.getMainModel()).func_191216_a(p_191361_1_).postRender(0.0625F);
}
});
}
示例8: renderArm
import net.minecraft.util.EnumHandSide; //導入依賴的package包/類
private void renderArm(EnumHandSide p_187455_1_)
{
this.mc.getTextureManager().bindTexture(this.mc.player.getLocationSkin());
Render<AbstractClientPlayer> render = this.renderManager.<AbstractClientPlayer>getEntityRenderObject(this.mc.player);
RenderPlayer renderplayer = (RenderPlayer)render;
GlStateManager.pushMatrix();
float f = p_187455_1_ == EnumHandSide.RIGHT ? 1.0F : -1.0F;
GlStateManager.rotate(92.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(45.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(f * -41.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.translate(f * 0.3F, -1.1F, 0.45F);
if (p_187455_1_ == EnumHandSide.RIGHT)
{
renderplayer.renderRightArm(this.mc.player);
}
else
{
renderplayer.renderLeftArm(this.mc.player);
}
GlStateManager.popMatrix();
}
示例9: renderMapFirstPersonSide
import net.minecraft.util.EnumHandSide; //導入依賴的package包/類
private void renderMapFirstPersonSide(float p_187465_1_, EnumHandSide p_187465_2_, float p_187465_3_, ItemStack p_187465_4_)
{
float f = p_187465_2_ == EnumHandSide.RIGHT ? 1.0F : -1.0F;
GlStateManager.translate(f * 0.125F, -0.125F, 0.0F);
if (!this.mc.player.isInvisible())
{
GlStateManager.pushMatrix();
GlStateManager.rotate(f * 10.0F, 0.0F, 0.0F, 1.0F);
this.renderArmFirstPerson(p_187465_1_, p_187465_3_, p_187465_2_);
GlStateManager.popMatrix();
}
GlStateManager.pushMatrix();
GlStateManager.translate(f * 0.51F, -0.08F + p_187465_1_ * -1.2F, -0.75F);
float f1 = MathHelper.sqrt(p_187465_3_);
float f2 = MathHelper.sin(f1 * (float)Math.PI);
float f3 = -0.5F * f2;
float f4 = 0.4F * MathHelper.sin(f1 * ((float)Math.PI * 2F));
float f5 = -0.3F * MathHelper.sin(p_187465_3_ * (float)Math.PI);
GlStateManager.translate(f * f3, f4 - 0.3F * f2, f5);
GlStateManager.rotate(f2 * -45.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(f * f2 * -30.0F, 0.0F, 1.0F, 0.0F);
this.renderMapFirstPerson(p_187465_4_);
GlStateManager.popMatrix();
}
示例10: transformEatFirstPerson
import net.minecraft.util.EnumHandSide; //導入依賴的package包/類
private void transformEatFirstPerson(float p_187454_1_, EnumHandSide p_187454_2_, ItemStack p_187454_3_)
{
float f = (float)this.mc.player.getItemInUseCount() - p_187454_1_ + 1.0F;
float f1 = f / (float)p_187454_3_.getMaxItemUseDuration();
if (f1 < 0.8F)
{
float f2 = MathHelper.abs(MathHelper.cos(f / 4.0F * (float)Math.PI) * 0.1F);
GlStateManager.translate(0.0F, f2, 0.0F);
}
float f3 = 1.0F - (float)Math.pow((double)f1, 27.0D);
int i = p_187454_2_ == EnumHandSide.RIGHT ? 1 : -1;
GlStateManager.translate(f3 * 0.6F * (float)i, f3 * -0.5F, f3 * 0.0F);
GlStateManager.rotate((float)i * f3 * 90.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(f3 * 10.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate((float)i * f3 * 30.0F, 0.0F, 0.0F, 1.0F);
}
示例11: setLivingAnimations
import net.minecraft.util.EnumHandSide; //導入依賴的package包/類
/**
* Used for easily adding entity-dependent animations. The second and third float params here are the same second
* and third as in the setRotationAngles method.
*/
public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime)
{
this.rightArmPose = ModelBiped.ArmPose.EMPTY;
this.leftArmPose = ModelBiped.ArmPose.EMPTY;
ItemStack itemstack = entitylivingbaseIn.getHeldItem(EnumHand.MAIN_HAND);
if (itemstack.getItem() == Items.BOW && ((AbstractSkeleton)entitylivingbaseIn).isSwingingArms())
{
if (entitylivingbaseIn.getPrimaryHand() == EnumHandSide.RIGHT)
{
this.rightArmPose = ModelBiped.ArmPose.BOW_AND_ARROW;
}
else
{
this.leftArmPose = ModelBiped.ArmPose.BOW_AND_ARROW;
}
}
super.setLivingAnimations(entitylivingbaseIn, p_78086_2_, p_78086_3_, partialTickTime);
}
示例12: postRenderArm
import net.minecraft.util.EnumHandSide; //導入依賴的package包/類
public void postRenderArm(float scale, EnumHandSide side)
{
ModelRenderer modelrenderer = this.getArmForSide(side);
if (this.smallArms)
{
float f = 0.5F * (float)(side == EnumHandSide.RIGHT ? 1 : -1);
modelrenderer.rotationPointX += f;
modelrenderer.postRender(scale);
modelrenderer.rotationPointX -= f;
}
else
{
modelrenderer.postRender(scale);
}
}
示例13: doRenderLayer
import net.minecraft.util.EnumHandSide; //導入依賴的package包/類
public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
boolean flag = entitylivingbaseIn.getPrimaryHand() == EnumHandSide.RIGHT;
ItemStack itemstack = flag ? entitylivingbaseIn.getHeldItemOffhand() : entitylivingbaseIn.getHeldItemMainhand();
ItemStack itemstack1 = flag ? entitylivingbaseIn.getHeldItemMainhand() : entitylivingbaseIn.getHeldItemOffhand();
if (itemstack != null || itemstack1 != null)
{
GlStateManager.pushMatrix();
if (this.livingEntityRenderer.getMainModel().isChild)
{
float f = 0.5F;
GlStateManager.translate(0.0F, 0.625F, 0.0F);
GlStateManager.rotate(-20.0F, -1.0F, 0.0F, 0.0F);
GlStateManager.scale(0.5F, 0.5F, 0.5F);
}
this.renderHeldItem(entitylivingbaseIn, itemstack1, ItemCameraTransforms.TransformType.THIRD_PERSON_RIGHT_HAND, EnumHandSide.RIGHT);
this.renderHeldItem(entitylivingbaseIn, itemstack, ItemCameraTransforms.TransformType.THIRD_PERSON_LEFT_HAND, EnumHandSide.LEFT);
GlStateManager.popMatrix();
}
}
示例14: renderHeldItem
import net.minecraft.util.EnumHandSide; //導入依賴的package包/類
private void renderHeldItem(EntityLivingBase p_188358_1_, ItemStack p_188358_2_, ItemCameraTransforms.TransformType p_188358_3_, EnumHandSide handSide)
{
if (p_188358_2_ != null)
{
GlStateManager.pushMatrix();
if (p_188358_1_.isSneaking())
{
GlStateManager.translate(0.0F, 0.2F, 0.0F);
}
// Forge: moved this call down, fixes incorrect offset while sneaking.
((ModelBiped)this.livingEntityRenderer.getMainModel()).postRenderArm(0.0625F, handSide);
GlStateManager.rotate(-90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
boolean flag = handSide == EnumHandSide.LEFT;
GlStateManager.translate((float)(flag ? -1 : 1) / 16.0F, 0.125F, -0.625F);
Minecraft.getMinecraft().getItemRenderer().renderItemSide(p_188358_1_, p_188358_2_, p_188358_3_, flag);
GlStateManager.popMatrix();
}
}
示例15: renderArm
import net.minecraft.util.EnumHandSide; //導入依賴的package包/類
private void renderArm(EnumHandSide p_187455_1_)
{
this.mc.getTextureManager().bindTexture(this.mc.thePlayer.getLocationSkin());
Render<AbstractClientPlayer> render = this.renderManager.<AbstractClientPlayer>getEntityRenderObject(this.mc.thePlayer);
RenderPlayer renderplayer = (RenderPlayer)render;
GlStateManager.pushMatrix();
float f = p_187455_1_ == EnumHandSide.RIGHT ? 1.0F : -1.0F;
GlStateManager.rotate(92.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(45.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(f * -41.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.translate(f * 0.3F, -1.1F, 0.45F);
if (p_187455_1_ == EnumHandSide.RIGHT)
{
renderplayer.renderRightArm(this.mc.thePlayer);
}
else
{
renderplayer.renderLeftArm(this.mc.thePlayer);
}
GlStateManager.popMatrix();
}