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


Java EntityRenderer类代码示例

本文整理汇总了Java中net.minecraft.client.renderer.EntityRenderer的典型用法代码示例。如果您正苦于以下问题:Java EntityRenderer类的具体用法?Java EntityRenderer怎么用?Java EntityRenderer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: renderQuads

import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
public static void renderQuads(VertexBuffer renderer, List<BakedQuad> quads, int color, ItemStack stack) {
	boolean flag = (color == -1) && (!stack.isEmpty());
	int i = 0;
	for (int j = quads.size(); i < j; i++) {
		BakedQuad bakedquad = quads.get(i);
		int k = color;
		if ((flag) && (bakedquad.hasTintIndex())) {
			ItemColors itemColors = Minecraft.getMinecraft().getItemColors();
			k = itemColors.getColorFromItemstack(stack, bakedquad.getTintIndex());
			if (EntityRenderer.anaglyphEnable) {
				k = TextureUtil.anaglyphColor(k);
			}
			k |= 0xFF000000;
		}
		LightUtil.renderQuadColor(renderer, bakedquad, k);
	}
}
 
开发者ID:p455w0rd,项目名称:DankNull,代码行数:18,代码来源:RenderModel.java

示例2: renderQuads

import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
private void renderQuads(WorldRenderer renderer, List<BakedQuad> quads, int color, ItemStack stack)
{
    boolean flag = color == -1 && stack != null;
    int i = 0;

    for (int j = quads.size(); i < j; ++i)
    {
        BakedQuad bakedquad = (BakedQuad)quads.get(i);
        int k = color;

        if (flag && bakedquad.hasTintIndex())
        {
            k = stack.getItem().getColorFromItemStack(stack, bakedquad.getTintIndex());

            if (EntityRenderer.anaglyphEnable)
            {
                k = TextureUtil.anaglyphColor(k);
            }

            k = k | -16777216;
        }

        this.renderQuad(renderer, bakedquad, k);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:26,代码来源:RenderItem.java

示例3: onEnable

import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
@Override
public void onEnable()
{
	if(!OpenGlHelper.shadersSupported)
	{
		wurst.events.add(UpdateListener.class, this);
		return;
	}
	
	if(!(mc.getRenderViewEntity() instanceof EntityPlayer))
	{
		setEnabled(false);
		return;
	}
	
	if(mc.entityRenderer.theShaderGroup != null)
		mc.entityRenderer.theShaderGroup.deleteShaderGroup();
	mc.entityRenderer.shaderIndex = 19;
	mc.entityRenderer.loadShader(EntityRenderer.SHADERS_TEXTURES[19]);
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:21,代码来源:LsdMod.java

示例4: renderHand0

import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
public static void renderHand0(EntityRenderer er, float par1, int par2)
{
    if (!Shaders.isShadowPass)
    {
        Item item = Shaders.itemToRender != null ? Shaders.itemToRender.getItem() : null;
        Block block = item instanceof ItemBlock ? ((ItemBlock)item).getBlock() : null;

        if (!(item instanceof ItemBlock) || !(block instanceof Block) || block.getBlockLayer() == EnumWorldBlockLayer.SOLID)
        {
            Shaders.readCenterDepth();
            Shaders.beginHand();
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            er.renderHand(par1, par2);
            Shaders.endHand();
            Shaders.isHandRendered = true;
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:19,代码来源:ShadersRender.java

示例5: renderHand0

import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
public static void renderHand0(EntityRenderer er, float par1, int par2)
{
    if (!Shaders.isShadowPass)
    {
        boolean flag = Shaders.isItemToRenderMainTranslucent();
        boolean flag1 = Shaders.isItemToRenderOffTranslucent();

        if (!flag || !flag1)
        {
            Shaders.readCenterDepth();
            Shaders.beginHand();
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            Shaders.setSkipRenderHands(flag, flag1);
            er.renderHand(par1, par2, true, false, false);
            Shaders.endHand();
            Shaders.setHandsRendered(!flag, !flag1);
            Shaders.setSkipRenderHands(false, false);
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:21,代码来源:ShadersRender.java

示例6: renderLivingLabel

import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
/**
 * Renders an entity's name above its head
 */
protected void renderLivingLabel(T entityIn, String str, double x, double y, double z, int maxDistance)
{
    double d0 = entityIn.getDistanceSqToEntity(this.renderManager.renderViewEntity);

    if (d0 <= (double)(maxDistance * maxDistance))
    {
        boolean flag = entityIn.isSneaking();
        float f = this.renderManager.playerViewY;
        float f1 = this.renderManager.playerViewX;
        boolean flag1 = this.renderManager.options.thirdPersonView == 2;
        float f2 = entityIn.height + 0.5F - (flag ? 0.25F : 0.0F);
        int i = "deadmau5".equals(str) ? -10 : 0;
        for(Friend friend: Wrapper.getFriends().friendsList) {
        	str.replace(friend.getName(), friend.getAlias());
        }
        if(Wrapper.getFriends().isFriend(str)) {
        	str = "\2479" + str;
        }
        if (entityIn instanceof EntityLivingBase) {
        str = str + " \247a" + ((double)Math.round((((EntityLivingBase) entityIn).getHealth() * 100) / 100) / 2);
        }
        if(!Hacks.findMod(Nametags.class).isEnabled())
        	EntityRenderer.drawNameplate(this.getFontRendererFromRenderManager(), str, (float)x, (float)y + f2, (float)z, i, f, f1, flag1, flag);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:29,代码来源:Render.java

示例7: renderLivingLabel

import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
/**
 * Renders an entity's name above its head
 */
protected void renderLivingLabel(T entityIn, String str, double x, double y, double z, int maxDistance)
{
    double d0 = entityIn.getDistanceSqToEntity(this.renderManager.renderViewEntity);

    if (d0 <= (double)(maxDistance * maxDistance))
    {
        boolean flag = entityIn.isSneaking();
        float f = this.renderManager.playerViewY;
        float f1 = this.renderManager.playerViewX;
        boolean flag1 = this.renderManager.options.thirdPersonView == 2;
        float f2 = entityIn.height + 0.5F - (flag ? 0.25F : 0.0F);
        int i = "deadmau5".equals(str) ? -10 : 0;
        EntityRenderer.drawNameplate(this.getFontRendererFromRenderManager(), str, (float)x, (float)y + f2, (float)z, i, f, f1, flag1, flag);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:19,代码来源:Render.java

示例8: setBrightness

import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
private int setBrightness(Tessellator tessellator, IBlockAccess blockAccess, int x, int y, int z, Block block) {
	int mb = block.getMixedBrightnessForBlock(blockAccess, x, y, z);
	tessellator.setBrightness(mb);

	float f = 1.0F;

	int l = block.colorMultiplier(blockAccess, x, y, z);
	float f1 = (l >> 16 & 0xFF) / 255.0F;
	float f2 = (l >> 8 & 0xFF) / 255.0F;
	float f3 = (l & 0xFF) / 255.0F;
	if (EntityRenderer.anaglyphEnable) {
		float f6 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F;
		float f4 = (f1 * 30.0F + f2 * 70.0F) / 100.0F;
		float f7 = (f1 * 30.0F + f3 * 70.0F) / 100.0F;
		f1 = f6;
		f2 = f4;
		f3 = f7;
	}
	tessellator.setColorOpaque_F(f * f1, f * f2, f * f3);
	return mb;
}
 
开发者ID:MJaroslav,项目名称:ThaumOres,代码行数:22,代码来源:TileInfusedBlockOreRenderer.java

示例9: renderStandardBlock

import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
public boolean renderStandardBlock(final Block p_147784_1_, final int p_147784_2_, final int p_147784_3_, final int p_147784_4_) {
    final int l = p_147784_1_.colorMultiplier(this.blockAccess, p_147784_2_, p_147784_3_, p_147784_4_);
    float f = (l >> 16 & 0xFF) / 255.0f;
    float f2 = (l >> 8 & 0xFF) / 255.0f;
    float f3 = (l & 0xFF) / 255.0f;
    if (EntityRenderer.anaglyphEnable) {
        final float f4 = (f * 30.0f + f2 * 59.0f + f3 * 11.0f) / 100.0f;
        final float f5 = (f * 30.0f + f2 * 70.0f) / 100.0f;
        final float f6 = (f * 30.0f + f3 * 70.0f) / 100.0f;
        f = f4;
        f2 = f5;
        f3 = f6;
    }
    f *= 0.75f;
    f2 *= 0.75f;
    f3 *= 0.75f;
    return this.renderStandardBlockWithColorMultiplier(p_147784_1_, p_147784_2_, p_147784_3_, p_147784_4_, f, f2, f3);
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:19,代码来源:FakeRenderEtherealBlocks.java

示例10: renderWorldBlock

import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
public boolean renderWorldBlock(final IBlockAccess world, final int par2, final int par3, final int par4, final Block par1Block, final int modelId, final RenderBlocks renderer) {
    final Tessellator var8 = Tessellator.instance;
    final int i = world.getBlockMetadata(par2, par3, par4);
    float f = BlockColor.initColor[i][0];
    float f2 = BlockColor.initColor[i][1];
    float f3 = BlockColor.initColor[i][2];
    final TileEntity data = world.getTileEntity(BlockColorData.dataBlockX(par2), BlockColorData.dataBlockY(par3), BlockColorData.dataBlockZ(par4));
    if (data instanceof TileEntityBlockColorData) {
        f = ((TileEntityBlockColorData)data).palette[i][0];
        f2 = ((TileEntityBlockColorData)data).palette[i][1];
        f3 = ((TileEntityBlockColorData)data).palette[i][2];
    }
    if (EntityRenderer.anaglyphEnable) {
        final float f4 = (f * 30.0f + f2 * 59.0f + f3 * 11.0f) / 100.0f;
        final float f5 = (f * 30.0f + f2 * 70.0f) / 100.0f;
        final float f6 = (f * 30.0f + f3 * 70.0f) / 100.0f;
        f = f4;
        f2 = f5;
        f3 = f6;
    }
    return (Minecraft.isAmbientOcclusionEnabled() && par1Block.getLightValue() == 0) ? renderer.renderStandardBlockWithAmbientOcclusion(par1Block, par2, par3, par4, f, f2, f3) : renderer.renderStandardBlockWithColorMultiplier(par1Block, par2, par3, par4, f, f2, f3);
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:23,代码来源:RenderBlockColor.java

示例11: renderBlockMeteor

import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
public void renderBlockMeteor(RenderBlocks renderBlocks, Block par1Block, IBlockAccess var1, int par2, int par3, int par4)
{
    Tessellator tessellator = Tessellator.instance;
    tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(var1, par2, par3, par4));
    float f = 1.0F;
    int l = par1Block.colorMultiplier(var1, par2, par3, par4);
    float f1 = (l >> 16 & 255) / 255.0F;
    float f2 = (l >> 8 & 255) / 255.0F;
    float f3 = (l & 255) / 255.0F;

    if (EntityRenderer.anaglyphEnable)
    {
        float f4 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F;
        float f5 = (f1 * 30.0F + f2 * 70.0F) / 100.0F;
        float f6 = (f1 * 30.0F + f3 * 70.0F) / 100.0F;
        f1 = f4;
        f2 = f5;
        f3 = f6;
    }

    tessellator.setColorOpaque_F(f * f1, f * f2, f * f3);

    renderBlocks.drawCrossedSquares(par1Block.getIcon(0, var1.getBlockMetadata(par2, par3, par4)), par2, par3, par4, 1.0F);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:25,代码来源:BlockRendererCavernousVines.java

示例12: renderEntityName

import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
/**
 * Renders an entity's name above its head (copied and modified from 
 * {@link RenderLivingBase})
 */
protected void renderEntityName(EntityLivingBase entity, String name, double x, double y, double z)
{
    if (name.isEmpty())
    {
        return;
    }

    boolean sneaking = entity.isSneaking();
    boolean thirdFrontal = this.manager.options.thirdPersonView == 2;

    float px = this.manager.playerViewY;
    float py = this.manager.playerViewX;
    float pz = entity.height + 0.5F - (sneaking ? 0.25F : 0.0F);

    int i = "deadmau5".equals(name) ? -10 : 0;

    EntityRenderer.drawNameplate(this.manager.getFontRenderer(), name, (float) x, (float) y + pz, (float) z, i, px, py, thirdFrontal, sneaking);
}
 
开发者ID:mchorse,项目名称:metamorph,代码行数:23,代码来源:RenderingHandler.java

示例13: playSplashSound

import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
protected void playSplashSound(final EntityRenderer renderer, final World world, final Entity player, double x,
		double y, double z) {

	this.pos.setPos(x, y - 1, z);
	final boolean hasDust = biomeHasDust(world.getBiome(this.pos));
	final Block block = WorldUtils.getBlockState(world, this.pos).getBlock();
	final SoundEvent sound = getBlockSoundFX(block, hasDust, world);
	if (sound != null) {
		final float volume = calculateRainSoundVolume(world);
		float pitch = 1.0F;
		final int playerY = MathHelper.floor(player.posY);
		this.pos.setPos(player.posX, 0, player.posZ);
		if (y > player.posY + 1.0D && getPrecipitationHeight(world, 0, this.pos).getY() > playerY)
			pitch = 0.5F;
		pitch -= (this.RANDOM.nextFloat() - this.RANDOM.nextFloat()) * 0.1F;
		this.pos.setPos(x, y, z);
		SoundEngine.instance().playSound(this.pos, sound, SoundCategory.WEATHER, volume, pitch);
	}
}
 
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:20,代码来源:StormSplashRenderer.java

示例14: onEnable

import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
@Override
public void onEnable() {
    if (OpenGlHelper.shadersSupported) {
        if (Minecraft.getMinecraft().func_175606_aa() instanceof EntityPlayer) {
            if (Minecraft.getMinecraft().entityRenderer.theShaderGroup != null) {
                Minecraft.getMinecraft().entityRenderer.theShaderGroup.deleteShaderGroup();
            }

            Minecraft.getMinecraft().entityRenderer.shaderIndex = 19;

            if (Minecraft.getMinecraft().entityRenderer.shaderIndex != EntityRenderer.shaderCount) {
                Minecraft.getMinecraft().entityRenderer.func_175069_a(EntityRenderer.shaderResourceLocations[19]);
            } else {
                Minecraft.getMinecraft().entityRenderer.theShaderGroup = null;
            }
        }
    }
    WurstClient.INSTANCE.events.add(UpdateListener.class, this);
}
 
开发者ID:null-dev,项目名称:EvenWurse,代码行数:20,代码来源:LsdMod.java

示例15: activateBatch

import net.minecraft.client.renderer.EntityRenderer; //导入依赖的package包/类
public void activateBatch()
{
    if(batch != null)
    {
        if(OpenGlHelper.shadersSupported)
        {
            try
            {
                ShaderGroup theShaderGroup = batch.toShaderGroup(resManager);
                theShaderGroup.createBindFramebuffers(Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight);
                ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, theShaderGroup, 51);
                ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, true, 55);
            }
            catch(JsonException e)
            {
                e.printStackTrace();
            }
        }
    }
}
 
开发者ID:jglrxavpok,项目名称:ShadyMod,代码行数:21,代码来源:ShadyMod.java


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