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


Java EntityLiving.isChild方法代码示例

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


在下文中一共展示了EntityLiving.isChild方法的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.isChild方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。