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


Java EntityLivingBase.getArrowCountInEntity方法代码示例

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


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

示例1: doRenderLayer

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
    int i = entitylivingbaseIn.getArrowCountInEntity();

    if (i > 0)
    {
        Entity entity = new EntityArrow(entitylivingbaseIn.worldObj, entitylivingbaseIn.posX, entitylivingbaseIn.posY, entitylivingbaseIn.posZ);
        Random random = new Random((long)entitylivingbaseIn.getEntityId());
        RenderHelper.disableStandardItemLighting();

        for (int j = 0; j < i; ++j)
        {
            GlStateManager.pushMatrix();
            ModelRenderer modelrenderer = this.field_177168_a.getMainModel().getRandomModelBox(random);
            ModelBox modelbox = (ModelBox)modelrenderer.cubeList.get(random.nextInt(modelrenderer.cubeList.size()));
            modelrenderer.postRender(0.0625F);
            float f = random.nextFloat();
            float f1 = random.nextFloat();
            float f2 = random.nextFloat();
            float f3 = (modelbox.posX1 + (modelbox.posX2 - modelbox.posX1) * f) / 16.0F;
            float f4 = (modelbox.posY1 + (modelbox.posY2 - modelbox.posY1) * f1) / 16.0F;
            float f5 = (modelbox.posZ1 + (modelbox.posZ2 - modelbox.posZ1) * f2) / 16.0F;
            GlStateManager.translate(f3, f4, f5);
            f = f * 2.0F - 1.0F;
            f1 = f1 * 2.0F - 1.0F;
            f2 = f2 * 2.0F - 1.0F;
            f = f * -1.0F;
            f1 = f1 * -1.0F;
            f2 = f2 * -1.0F;
            float f6 = MathHelper.sqrt_float(f * f + f2 * f2);
            entity.prevRotationYaw = entity.rotationYaw = (float)(Math.atan2((double)f, (double)f2) * 180.0D / Math.PI);
            entity.prevRotationPitch = entity.rotationPitch = (float)(Math.atan2((double)f1, (double)f6) * 180.0D / Math.PI);
            double d0 = 0.0D;
            double d1 = 0.0D;
            double d2 = 0.0D;
            this.field_177168_a.getRenderManager().renderEntityWithPosYaw(entity, d0, d1, d2, 0.0F, partialTicks);
            GlStateManager.popMatrix();
        }

        RenderHelper.enableStandardItemLighting();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:43,代码来源:LayerArrow.java

示例2: doRenderLayer

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    int i = entitylivingbaseIn.getArrowCountInEntity();

    if (i > 0)
    {
        Entity entity = new EntityTippedArrow(entitylivingbaseIn.world, entitylivingbaseIn.posX, entitylivingbaseIn.posY, entitylivingbaseIn.posZ);
        Random random = new Random((long)entitylivingbaseIn.getEntityId());
        RenderHelper.disableStandardItemLighting();

        for (int j = 0; j < i; ++j)
        {
            GlStateManager.pushMatrix();
            ModelRenderer modelrenderer = this.renderer.getMainModel().getRandomModelBox(random);
            ModelBox modelbox = (ModelBox)modelrenderer.cubeList.get(random.nextInt(modelrenderer.cubeList.size()));
            modelrenderer.postRender(0.0625F);
            float f = random.nextFloat();
            float f1 = random.nextFloat();
            float f2 = random.nextFloat();
            float f3 = (modelbox.posX1 + (modelbox.posX2 - modelbox.posX1) * f) / 16.0F;
            float f4 = (modelbox.posY1 + (modelbox.posY2 - modelbox.posY1) * f1) / 16.0F;
            float f5 = (modelbox.posZ1 + (modelbox.posZ2 - modelbox.posZ1) * f2) / 16.0F;
            GlStateManager.translate(f3, f4, f5);
            f = f * 2.0F - 1.0F;
            f1 = f1 * 2.0F - 1.0F;
            f2 = f2 * 2.0F - 1.0F;
            f = f * -1.0F;
            f1 = f1 * -1.0F;
            f2 = f2 * -1.0F;
            float f6 = MathHelper.sqrt(f * f + f2 * f2);
            entity.rotationYaw = (float)(Math.atan2((double)f, (double)f2) * (180D / Math.PI));
            entity.rotationPitch = (float)(Math.atan2((double)f1, (double)f6) * (180D / Math.PI));
            entity.prevRotationYaw = entity.rotationYaw;
            entity.prevRotationPitch = entity.rotationPitch;
            double d0 = 0.0D;
            double d1 = 0.0D;
            double d2 = 0.0D;
            this.renderer.getRenderManager().doRenderEntity(entity, 0.0D, 0.0D, 0.0D, 0.0F, partialTicks, false);
            GlStateManager.popMatrix();
        }

        RenderHelper.enableStandardItemLighting();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:45,代码来源:LayerArrow.java

示例3: doRenderLayer

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    int i = entitylivingbaseIn.getArrowCountInEntity();

    if (i > 0)
    {
        Entity entity = new EntityTippedArrow(entitylivingbaseIn.worldObj, entitylivingbaseIn.posX, entitylivingbaseIn.posY, entitylivingbaseIn.posZ);
        Random random = new Random((long)entitylivingbaseIn.getEntityId());
        RenderHelper.disableStandardItemLighting();

        for (int j = 0; j < i; ++j)
        {
            GlStateManager.pushMatrix();
            ModelRenderer modelrenderer = this.renderer.getMainModel().getRandomModelBox(random);
            ModelBox modelbox = (ModelBox)modelrenderer.cubeList.get(random.nextInt(modelrenderer.cubeList.size()));
            modelrenderer.postRender(0.0625F);
            float f = random.nextFloat();
            float f1 = random.nextFloat();
            float f2 = random.nextFloat();
            float f3 = (modelbox.posX1 + (modelbox.posX2 - modelbox.posX1) * f) / 16.0F;
            float f4 = (modelbox.posY1 + (modelbox.posY2 - modelbox.posY1) * f1) / 16.0F;
            float f5 = (modelbox.posZ1 + (modelbox.posZ2 - modelbox.posZ1) * f2) / 16.0F;
            GlStateManager.translate(f3, f4, f5);
            f = f * 2.0F - 1.0F;
            f1 = f1 * 2.0F - 1.0F;
            f2 = f2 * 2.0F - 1.0F;
            f = f * -1.0F;
            f1 = f1 * -1.0F;
            f2 = f2 * -1.0F;
            float f6 = MathHelper.sqrt_float(f * f + f2 * f2);
            entity.rotationYaw = (float)(Math.atan2((double)f, (double)f2) * (180D / Math.PI));
            entity.rotationPitch = (float)(Math.atan2((double)f1, (double)f6) * (180D / Math.PI));
            entity.prevRotationYaw = entity.rotationYaw;
            entity.prevRotationPitch = entity.rotationPitch;
            double d0 = 0.0D;
            double d1 = 0.0D;
            double d2 = 0.0D;
            this.renderer.getRenderManager().doRenderEntity(entity, 0.0D, 0.0D, 0.0D, 0.0F, partialTicks, false);
            GlStateManager.popMatrix();
        }

        RenderHelper.enableStandardItemLighting();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:45,代码来源:LayerArrow.java


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