當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。