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