當前位置: 首頁>>代碼示例>>Java>>正文


Java EntityLiving.getRenderSizeModifier方法代碼示例

本文整理匯總了Java中net.minecraft.entity.EntityLiving.getRenderSizeModifier方法的典型用法代碼示例。如果您正苦於以下問題:Java EntityLiving.getRenderSizeModifier方法的具體用法?Java EntityLiving.getRenderSizeModifier怎麽用?Java EntityLiving.getRenderSizeModifier使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.entity.EntityLiving的用法示例。


在下文中一共展示了EntityLiving.getRenderSizeModifier方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: renderShadow

import net.minecraft.entity.EntityLiving; //導入方法依賴的package包/類
/**
 * Renders the entity shadows at the position, shadow alpha and partialTickTime. Args: entity, x, y, z, shadowAlpha,
 * partialTickTime
 */
private void renderShadow(Entity entityIn, double x, double y, double z, float shadowAlpha, float partialTicks)
{
    GlStateManager.enableBlend();
    GlStateManager.blendFunc(770, 771);
    this.renderManager.renderEngine.bindTexture(shadowTextures);
    World world = this.getWorldFromRenderManager();
    GlStateManager.depthMask(false);
    float f = this.shadowSize;

    if (entityIn instanceof EntityLiving)
    {
        EntityLiving entityliving = (EntityLiving)entityIn;
        f *= entityliving.getRenderSizeModifier();

        if (entityliving.isChild())
        {
            f *= 0.5F;
        }
    }

    double d5 = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * (double)partialTicks;
    double d0 = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * (double)partialTicks;
    double d1 = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * (double)partialTicks;
    int i = MathHelper.floor_double(d5 - (double)f);
    int j = MathHelper.floor_double(d5 + (double)f);
    int k = MathHelper.floor_double(d0 - (double)f);
    int l = MathHelper.floor_double(d0);
    int i1 = MathHelper.floor_double(d1 - (double)f);
    int j1 = MathHelper.floor_double(d1 + (double)f);
    double d2 = x - d5;
    double d3 = y - d0;
    double d4 = z - d1;
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);

    for (BlockPos blockpos : BlockPos.getAllInBoxMutable(new BlockPos(i, k, i1), new BlockPos(j, l, j1)))
    {
        Block block = world.getBlockState(blockpos.down()).getBlock();

        if (block.getRenderType() != -1 && world.getLightFromNeighbors(blockpos) > 3)
        {
            this.func_180549_a(block, x, y, z, blockpos, shadowAlpha, f, d2, d3, d4);
        }
    }

    tessellator.draw();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    GlStateManager.disableBlend();
    GlStateManager.depthMask(true);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:56,代碼來源:Render.java

示例2: renderShadow

import net.minecraft.entity.EntityLiving; //導入方法依賴的package包/類
/**
 * Renders the entity shadows at the position, shadow alpha and partialTickTime. Args: entity, x, y, z, shadowAlpha,
 * partialTickTime
 */
private void renderShadow(Entity entityIn, double x, double y, double z, float shadowAlpha, float partialTicks)
{
    if (!Config.isShaders() || !Shaders.shouldSkipDefaultShadow)
    {
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(770, 771);
        this.renderManager.renderEngine.bindTexture(shadowTextures);
        World world = this.getWorldFromRenderManager();
        GlStateManager.depthMask(false);
        float f = this.shadowSize;

        if (entityIn instanceof EntityLiving)
        {
            EntityLiving entityliving = (EntityLiving)entityIn;
            f *= entityliving.getRenderSizeModifier();

            if (entityliving.isChild())
            {
                f *= 0.5F;
            }
        }

        double d5 = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * (double)partialTicks;
        double d0 = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * (double)partialTicks;
        double d1 = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * (double)partialTicks;
        int i = MathHelper.floor_double(d5 - (double)f);
        int j = MathHelper.floor_double(d5 + (double)f);
        int k = MathHelper.floor_double(d0 - (double)f);
        int l = MathHelper.floor_double(d0);
        int i1 = MathHelper.floor_double(d1 - (double)f);
        int j1 = MathHelper.floor_double(d1 + (double)f);
        double d2 = x - d5;
        double d3 = y - d0;
        double d4 = z - d1;
        Tessellator tessellator = Tessellator.getInstance();
        WorldRenderer worldrenderer = tessellator.getWorldRenderer();
        worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);

        for (BlockPos blockpos : BlockPos.getAllInBoxMutable(new BlockPos(i, k, i1), new BlockPos(j, l, j1)))
        {
            Block block = world.getBlockState(blockpos.down()).getBlock();

            if (block.getRenderType() != -1 && world.getLightFromNeighbors(blockpos) > 3)
            {
                this.func_180549_a(block, x, y, z, blockpos, shadowAlpha, f, d2, d3, d4);
            }
        }

        tessellator.draw();
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        GlStateManager.disableBlend();
        GlStateManager.depthMask(true);
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:59,代碼來源:Render.java

示例3: renderShadow

import net.minecraft.entity.EntityLiving; //導入方法依賴的package包/類
/**
 * Renders the entity shadows at the position, shadow alpha and partialTickTime.
 * Args: entity, x, y, z, shadowAlpha, partialTickTime
 */
private void renderShadow(Entity entityIn, double x, double y, double z, float shadowAlpha, float partialTicks) {
	GlStateManager.enableBlend();
	GlStateManager.blendFunc(770, 771);
	this.renderManager.renderEngine.bindTexture(shadowTextures);
	World world = this.getWorldFromRenderManager();
	GlStateManager.depthMask(false);
	float f = this.shadowSize;

	if (entityIn instanceof EntityLiving) {
		EntityLiving entityliving = (EntityLiving) entityIn;
		f *= entityliving.getRenderSizeModifier();

		if (entityliving.isChild()) {
			f *= 0.5F;
		}
	}

	double d5 = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * (double) partialTicks;
	double d0 = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * (double) partialTicks;
	double d1 = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * (double) partialTicks;
	int i = MathHelper.floor_double(d5 - (double) f);
	int j = MathHelper.floor_double(d5 + (double) f);
	int k = MathHelper.floor_double(d0 - (double) f);
	int l = MathHelper.floor_double(d0);
	int i1 = MathHelper.floor_double(d1 - (double) f);
	int j1 = MathHelper.floor_double(d1 + (double) f);
	double d2 = x - d5;
	double d3 = y - d0;
	double d4 = z - d1;
	Tessellator tessellator = Tessellator.getInstance();
	WorldRenderer worldrenderer = tessellator.getWorldRenderer();
	worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);

	for (BlockPos blockpos : BlockPos.getAllInBoxMutable(new BlockPos(i, k, i1), new BlockPos(j, l, j1))) {
		Block block = world.getBlockState(blockpos.down()).getBlock();

		if (block.getRenderType() != -1 && world.getLightFromNeighbors(blockpos) > 3) {
			this.func_180549_a(block, x, y, z, blockpos, shadowAlpha, f, d2, d3, d4);
		}
	}

	tessellator.draw();
	GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
	GlStateManager.disableBlend();
	GlStateManager.depthMask(true);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:51,代碼來源:Render.java

示例4: renderShadow

import net.minecraft.entity.EntityLiving; //導入方法依賴的package包/類
/**
 * Renders the entities shadow.
 */
private void renderShadow(Entity entityIn, double x, double y, double z, float shadowAlpha, float partialTicks)
{
    if (!Config.isShaders() || !Shaders.shouldSkipDefaultShadow)
    {
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
        this.renderManager.renderEngine.bindTexture(SHADOW_TEXTURES);
        World world = this.getWorldFromRenderManager();
        GlStateManager.depthMask(false);
        float f = this.shadowSize;

        if (entityIn instanceof EntityLiving)
        {
            EntityLiving entityliving = (EntityLiving)entityIn;
            f *= entityliving.getRenderSizeModifier();

            if (entityliving.isChild())
            {
                f *= 0.5F;
            }
        }

        double d5 = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * (double)partialTicks;
        double d0 = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * (double)partialTicks;
        double d1 = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * (double)partialTicks;
        int i = MathHelper.floor(d5 - (double)f);
        int j = MathHelper.floor(d5 + (double)f);
        int k = MathHelper.floor(d0 - (double)f);
        int l = MathHelper.floor(d0);
        int i1 = MathHelper.floor(d1 - (double)f);
        int j1 = MathHelper.floor(d1 + (double)f);
        double d2 = x - d5;
        double d3 = y - d0;
        double d4 = z - d1;
        Tessellator tessellator = Tessellator.getInstance();
        VertexBuffer vertexbuffer = tessellator.getBuffer();
        vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);

        for (BlockPos blockpos : BlockPos.getAllInBoxMutable(new BlockPos(i, k, i1), new BlockPos(j, l, j1)))
        {
            IBlockState iblockstate = world.getBlockState(blockpos.down());

            if (iblockstate.getRenderType() != EnumBlockRenderType.INVISIBLE && world.getLightFromNeighbors(blockpos) > 3)
            {
                this.renderShadowSingle(iblockstate, x, y, z, blockpos, shadowAlpha, f, d2, d3, d4);
            }
        }

        tessellator.draw();
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        GlStateManager.disableBlend();
        GlStateManager.depthMask(true);
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:58,代碼來源:Render.java

示例5: renderShadow

import net.minecraft.entity.EntityLiving; //導入方法依賴的package包/類
/**
 * Renders the entities shadow.
 */
private void renderShadow(Entity entityIn, double x, double y, double z, float shadowAlpha, float partialTicks)
{
    GlStateManager.enableBlend();
    GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
    this.renderManager.renderEngine.bindTexture(SHADOW_TEXTURES);
    World world = this.getWorldFromRenderManager();
    GlStateManager.depthMask(false);
    float f = this.shadowSize;

    if (entityIn instanceof EntityLiving)
    {
        EntityLiving entityliving = (EntityLiving)entityIn;
        f *= entityliving.getRenderSizeModifier();

        if (entityliving.isChild())
        {
            f *= 0.5F;
        }
    }

    double d5 = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * (double)partialTicks;
    double d0 = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * (double)partialTicks;
    double d1 = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * (double)partialTicks;
    int i = MathHelper.floor_double(d5 - (double)f);
    int j = MathHelper.floor_double(d5 + (double)f);
    int k = MathHelper.floor_double(d0 - (double)f);
    int l = MathHelper.floor_double(d0);
    int i1 = MathHelper.floor_double(d1 - (double)f);
    int j1 = MathHelper.floor_double(d1 + (double)f);
    double d2 = x - d5;
    double d3 = y - d0;
    double d4 = z - d1;
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);

    for (BlockPos blockpos : BlockPos.getAllInBoxMutable(new BlockPos(i, k, i1), new BlockPos(j, l, j1)))
    {
        IBlockState iblockstate = world.getBlockState(blockpos.down());

        if (iblockstate.getRenderType() != EnumBlockRenderType.INVISIBLE && world.getLightFromNeighbors(blockpos) > 3)
        {
            this.renderShadowSingle(iblockstate, x, y, z, blockpos, shadowAlpha, f, d2, d3, d4);
        }
    }

    tessellator.draw();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    GlStateManager.disableBlend();
    GlStateManager.depthMask(true);
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:55,代碼來源:Render.java


注:本文中的net.minecraft.entity.EntityLiving.getRenderSizeModifier方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。