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


Java Tessellator.getWorldRenderer方法代码示例

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


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

示例1: renderLitParticles

import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
public void renderLitParticles(Entity entityIn, float p_78872_2_)
{
    float f = 0.017453292F;
    float f1 = MathHelper.cos(entityIn.rotationYaw * 0.017453292F);
    float f2 = MathHelper.sin(entityIn.rotationYaw * 0.017453292F);
    float f3 = -f2 * MathHelper.sin(entityIn.rotationPitch * 0.017453292F);
    float f4 = f1 * MathHelper.sin(entityIn.rotationPitch * 0.017453292F);
    float f5 = MathHelper.cos(entityIn.rotationPitch * 0.017453292F);

    for (int i = 0; i < 2; ++i)
    {
        List list = this.fxLayers[3][i];

        if (!list.isEmpty())
        {
            Tessellator tessellator = Tessellator.getInstance();
            WorldRenderer worldrenderer = tessellator.getWorldRenderer();

            for (int j = 0; j < list.size(); ++j)
            {
                EntityFX entityfx = (EntityFX)list.get(j);
                entityfx.renderParticle(worldrenderer, entityIn, p_78872_2_, f1, f5, f2, f3, f4);
            }
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:27,代码来源:EffectRenderer.java

示例2: func_148171_c

import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
private void func_148171_c(int p_148171_1_, int p_148171_2_, int p_148171_3_, int p_148171_4_)
{
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(Gui.statIcons);
    float f = 0.0078125F;
    float f1 = 0.0078125F;
    int i = 18;
    int j = 18;
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
    worldrenderer.pos((double)(p_148171_1_ + 0), (double)(p_148171_2_ + 18), (double)GuiFlatPresets.this.zLevel).tex((double)((float)(p_148171_3_ + 0) * 0.0078125F), (double)((float)(p_148171_4_ + 18) * 0.0078125F)).endVertex();
    worldrenderer.pos((double)(p_148171_1_ + 18), (double)(p_148171_2_ + 18), (double)GuiFlatPresets.this.zLevel).tex((double)((float)(p_148171_3_ + 18) * 0.0078125F), (double)((float)(p_148171_4_ + 18) * 0.0078125F)).endVertex();
    worldrenderer.pos((double)(p_148171_1_ + 18), (double)(p_148171_2_ + 0), (double)GuiFlatPresets.this.zLevel).tex((double)((float)(p_148171_3_ + 18) * 0.0078125F), (double)((float)(p_148171_4_ + 0) * 0.0078125F)).endVertex();
    worldrenderer.pos((double)(p_148171_1_ + 0), (double)(p_148171_2_ + 0), (double)GuiFlatPresets.this.zLevel).tex((double)((float)(p_148171_3_ + 0) * 0.0078125F), (double)((float)(p_148171_4_ + 0) * 0.0078125F)).endVertex();
    tessellator.draw();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:18,代码来源:GuiFlatPresets.java

示例3: drawSelectionBox

import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
/**
 * Draws the selection box around the selected slot element.
 */
protected void drawSelectionBox(int p_148120_1_, int p_148120_2_, int mouseXIn, int mouseYIn)
{
    int i = this.getSize();
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();

    for (int j = 0; j < i; ++j)
    {
        int k = p_148120_2_ + j * this.slotHeight + this.headerPadding;
        int l = this.slotHeight - 4;

        if (k > this.bottom || k + l < this.top)
        {
            this.func_178040_a(j, p_148120_1_, k);
        }

        if (this.showSelectionBox && this.isSelected(j))
        {
            int i1 = this.left + (this.width / 2 - this.getListWidth() / 2);
            int j1 = this.left + this.width / 2 + this.getListWidth() / 2;
            GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
            GlStateManager.disableTexture2D();
            worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
            worldrenderer.pos((double)i1, (double)(k + l + 2), 0.0D).tex(0.0D, 1.0D).color(128, 128, 128, 255).endVertex();
            worldrenderer.pos((double)j1, (double)(k + l + 2), 0.0D).tex(1.0D, 1.0D).color(128, 128, 128, 255).endVertex();
            worldrenderer.pos((double)j1, (double)(k - 2), 0.0D).tex(1.0D, 0.0D).color(128, 128, 128, 255).endVertex();
            worldrenderer.pos((double)i1, (double)(k - 2), 0.0D).tex(0.0D, 0.0D).color(128, 128, 128, 255).endVertex();
            worldrenderer.pos((double)(i1 + 1), (double)(k + l + 1), 0.0D).tex(0.0D, 1.0D).color(0, 0, 0, 255).endVertex();
            worldrenderer.pos((double)(j1 - 1), (double)(k + l + 1), 0.0D).tex(1.0D, 1.0D).color(0, 0, 0, 255).endVertex();
            worldrenderer.pos((double)(j1 - 1), (double)(k - 1), 0.0D).tex(1.0D, 0.0D).color(0, 0, 0, 255).endVertex();
            worldrenderer.pos((double)(i1 + 1), (double)(k - 1), 0.0D).tex(0.0D, 0.0D).color(0, 0, 0, 255).endVertex();
            tessellator.draw();
            GlStateManager.enableTexture2D();
        }

        this.drawSlot(j, p_148120_1_, k, l, mouseXIn, mouseYIn);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:42,代码来源:GuiSlot.java

示例4: renderSkybox

import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
private void renderSkybox(int p_73971_1_, int p_73971_2_, float p_73971_3_) {
	this.mc.getFramebuffer().unbindFramebuffer();
	GlStateManager.viewport(0, 0, 256, 256);
	this.drawPanorama(p_73971_1_, p_73971_2_, p_73971_3_);
	this.rotateAndBlurSkybox(p_73971_3_);
	this.rotateAndBlurSkybox(p_73971_3_);
	this.rotateAndBlurSkybox(p_73971_3_);
	this.rotateAndBlurSkybox(p_73971_3_);
	this.rotateAndBlurSkybox(p_73971_3_);
	this.rotateAndBlurSkybox(p_73971_3_);
	this.rotateAndBlurSkybox(p_73971_3_);
	this.mc.getFramebuffer().bindFramebuffer(true);
	GlStateManager.viewport(0, 0, this.mc.displayWidth, this.mc.displayHeight);
	float f = this.width > this.height ? 120.0F / (float) this.width : 120.0F / (float) this.height;
	float f1 = (float) this.height * f / 256.0F;
	float f2 = (float) this.width * f / 256.0F;
	int i = this.width;
	int j = this.height;
	Tessellator tessellator = Tessellator.getInstance();
	WorldRenderer worldrenderer = tessellator.getWorldRenderer();
	worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
	worldrenderer.pos(0.0D, (double) j, (double) this.zLevel).tex((double) (0.5F - f1), (double) (0.5F + f2))
			.color(1.0F, 1.0F, 1.0F, 1.0F).endVertex();
	worldrenderer.pos((double) i, (double) j, (double) this.zLevel).tex((double) (0.5F - f1), (double) (0.5F - f2))
			.color(1.0F, 1.0F, 1.0F, 1.0F).endVertex();
	worldrenderer.pos((double) i, 0.0D, (double) this.zLevel).tex((double) (0.5F + f1), (double) (0.5F - f2))
			.color(1.0F, 1.0F, 1.0F, 1.0F).endVertex();
	worldrenderer.pos(0.0D, 0.0D, (double) this.zLevel).tex((double) (0.5F + f1), (double) (0.5F + f2))
			.color(1.0F, 1.0F, 1.0F, 1.0F).endVertex();
	tessellator.draw();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:32,代码来源:GuiLoading.java

示例5: drawScaledCustomSizeModalRect

import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
/**
 * Draws a scaled, textured, tiled modal rect at z = 0. This method isn't used anywhere in vanilla code.
 */
public static void drawScaledCustomSizeModalRect(int x, int y, float u, float v, int uWidth, int vHeight, int width, int height, float tileWidth, float tileHeight)
{
    float f = 1.0F / tileWidth;
    float f1 = 1.0F / tileHeight;
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
    worldrenderer.pos((double)x, (double)(y + height), 0.0D).tex((double)(u * f), (double)((v + (float)vHeight) * f1)).endVertex();
    worldrenderer.pos((double)(x + width), (double)(y + height), 0.0D).tex((double)((u + (float)uWidth) * f), (double)((v + (float)vHeight) * f1)).endVertex();
    worldrenderer.pos((double)(x + width), (double)y, 0.0D).tex((double)((u + (float)uWidth) * f), (double)(v * f1)).endVertex();
    worldrenderer.pos((double)x, (double)y, 0.0D).tex((double)(u * f), (double)(v * f1)).endVertex();
    tessellator.draw();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:17,代码来源:Gui.java

示例6: drawTexturedModalRect

import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
/**
 * Draws a textured rectangle at the stored z-value. Args: x, y, u, v, width, height
 */
public void drawTexturedModalRect(int x, int y, int textureX, int textureY, int width, int height)
{
    float f = 0.00390625F;
    float f1 = 0.00390625F;
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
    worldrenderer.pos((double)(x + 0), (double)(y + height), (double)this.zLevel).tex((double)((float)(textureX + 0) * f), (double)((float)(textureY + height) * f1)).endVertex();
    worldrenderer.pos((double)(x + width), (double)(y + height), (double)this.zLevel).tex((double)((float)(textureX + width) * f), (double)((float)(textureY + height) * f1)).endVertex();
    worldrenderer.pos((double)(x + width), (double)(y + 0), (double)this.zLevel).tex((double)((float)(textureX + width) * f), (double)((float)(textureY + 0) * f1)).endVertex();
    worldrenderer.pos((double)(x + 0), (double)(y + 0), (double)this.zLevel).tex((double)((float)(textureX + 0) * f), (double)((float)(textureY + 0) * f1)).endVertex();
    tessellator.draw();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:17,代码来源:Gui.java

示例7: drawGradientRect

import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
/**
 * Draws a rectangle with a vertical gradient between the specified colors (ARGB format). Args : x1, y1, x2, y2,
 * topColor, bottomColor
 */
protected void drawGradientRect(int left, int top, int right, int bottom, int startColor, int endColor)
{
    float f = (float)(startColor >> 24 & 255) / 255.0F;
    float f1 = (float)(startColor >> 16 & 255) / 255.0F;
    float f2 = (float)(startColor >> 8 & 255) / 255.0F;
    float f3 = (float)(startColor & 255) / 255.0F;
    float f4 = (float)(endColor >> 24 & 255) / 255.0F;
    float f5 = (float)(endColor >> 16 & 255) / 255.0F;
    float f6 = (float)(endColor >> 8 & 255) / 255.0F;
    float f7 = (float)(endColor & 255) / 255.0F;
    GlStateManager.disableTexture2D();
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    GlStateManager.shadeModel(7425);
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
    worldrenderer.pos((double)right, (double)top, (double)this.zLevel).color(f1, f2, f3, f).endVertex();
    worldrenderer.pos((double)left, (double)top, (double)this.zLevel).color(f1, f2, f3, f).endVertex();
    worldrenderer.pos((double)left, (double)bottom, (double)this.zLevel).color(f5, f6, f7, f4).endVertex();
    worldrenderer.pos((double)right, (double)bottom, (double)this.zLevel).color(f5, f6, f7, f4).endVertex();
    tessellator.draw();
    GlStateManager.shadeModel(7424);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
    GlStateManager.enableTexture2D();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:33,代码来源:Gui.java

示例8: doRender

import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doe
 */
public void doRender(EntityFireball entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    this.bindEntityTexture(entity);
    GlStateManager.translate((float)x, (float)y, (float)z);
    GlStateManager.enableRescaleNormal();
    GlStateManager.scale(this.scale, this.scale, this.scale);
    TextureAtlasSprite textureatlassprite = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getParticleIcon(Items.fire_charge);
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    float f = textureatlassprite.getMinU();
    float f1 = textureatlassprite.getMaxU();
    float f2 = textureatlassprite.getMinV();
    float f3 = textureatlassprite.getMaxV();
    float f4 = 1.0F;
    float f5 = 0.5F;
    float f6 = 0.25F;
    GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_NORMAL);
    worldrenderer.pos(-0.5D, -0.25D, 0.0D).tex((double)f, (double)f3).normal(0.0F, 1.0F, 0.0F).endVertex();
    worldrenderer.pos(0.5D, -0.25D, 0.0D).tex((double)f1, (double)f3).normal(0.0F, 1.0F, 0.0F).endVertex();
    worldrenderer.pos(0.5D, 0.75D, 0.0D).tex((double)f1, (double)f2).normal(0.0F, 1.0F, 0.0F).endVertex();
    worldrenderer.pos(-0.5D, 0.75D, 0.0D).tex((double)f, (double)f2).normal(0.0F, 1.0F, 0.0F).endVertex();
    tessellator.draw();
    GlStateManager.disableRescaleNormal();
    GlStateManager.popMatrix();
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:36,代码来源:RenderFireball.java

示例9: renderModel

import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
private void renderModel(IBakedModel model, int color, ItemStack stack)
{
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    worldrenderer.begin(7, DefaultVertexFormats.ITEM);

    for (EnumFacing enumfacing : EnumFacing.values())
    {
        this.renderQuads(worldrenderer, model.getFaceQuads(enumfacing), color, stack);
    }

    this.renderQuads(worldrenderer, model.getGeneralQuads(), color, stack);
    tessellator.draw();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:15,代码来源:RenderItem.java

示例10: renderSide

import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
private void renderSide(Tessellator p_renderSide_1_, int p_renderSide_2_)
{
    WorldRenderer worldrenderer = p_renderSide_1_.getWorldRenderer();
    double d0 = (double)(p_renderSide_2_ % 3) / 3.0D;
    double d1 = (double)(p_renderSide_2_ / 3) / 2.0D;
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
    worldrenderer.pos(-100.0D, -100.0D, -100.0D).tex(d0, d1).endVertex();
    worldrenderer.pos(-100.0D, -100.0D, 100.0D).tex(d0, d1 + 0.5D).endVertex();
    worldrenderer.pos(100.0D, -100.0D, 100.0D).tex(d0 + 0.3333333333333333D, d1 + 0.5D).endVertex();
    worldrenderer.pos(100.0D, -100.0D, -100.0D).tex(d0 + 0.3333333333333333D, d1).endVertex();
    p_renderSide_1_.draw();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:13,代码来源:CustomSkyLayer.java

示例11: showLagometer

import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
public static void showLagometer(ScaledResolution p_showLagometer_0_)
{
    if (gameSettings != null)
    {
        if (gameSettings.ofLagometer || gameSettings.field_181657_aC)
        {
            long i = System.nanoTime();
            GlStateManager.clear(256);
            GlStateManager.matrixMode(5889);
            GlStateManager.pushMatrix();
            GlStateManager.enableColorMaterial();
            GlStateManager.loadIdentity();
            GlStateManager.ortho(0.0D, (double)mc.displayWidth, (double)mc.displayHeight, 0.0D, 1000.0D, 3000.0D);
            GlStateManager.matrixMode(5888);
            GlStateManager.pushMatrix();
            GlStateManager.loadIdentity();
            GlStateManager.translate(0.0F, 0.0F, -2000.0F);
            GL11.glLineWidth(1.0F);
            GlStateManager.disableTexture2D();
            Tessellator tessellator = Tessellator.getInstance();
            WorldRenderer worldrenderer = tessellator.getWorldRenderer();
            worldrenderer.begin(1, DefaultVertexFormats.POSITION_COLOR);

            for (int j = 0; j < timesFrame.length; ++j)
            {
                int k = (j - numRecordedFrameTimes & timesFrame.length - 1) * 100 / timesFrame.length;
                k = k + 155;
                float f = (float)mc.displayHeight;
                long l = 0L;

                if (gcs[j])
                {
                    renderTime(j, timesFrame[j], k, k / 2, 0, f, worldrenderer);
                }
                else
                {
                    renderTime(j, timesFrame[j], k, k, k, f, worldrenderer);
                    f = f - (float)renderTime(j, timesServer[j], k / 2, k / 2, k / 2, f, worldrenderer);
                    f = f - (float)renderTime(j, timesTerrain[j], 0, k, 0, f, worldrenderer);
                    f = f - (float)renderTime(j, timesVisibility[j], k, k, 0, f, worldrenderer);
                    f = f - (float)renderTime(j, timesChunkUpdate[j], k, 0, 0, f, worldrenderer);
                    f = f - (float)renderTime(j, timesChunkUpload[j], k, 0, k, f, worldrenderer);
                    f = f - (float)renderTime(j, timesScheduledExecutables[j], 0, 0, k, f, worldrenderer);
                    float f2 = f - (float)renderTime(j, timesTick[j], 0, k, k, f, worldrenderer);
                }
            }

            renderTimeDivider(0, timesFrame.length, 33333333L, 196, 196, 196, (float)mc.displayHeight, worldrenderer);
            renderTimeDivider(0, timesFrame.length, 16666666L, 196, 196, 196, (float)mc.displayHeight, worldrenderer);
            tessellator.draw();
            GlStateManager.enableTexture2D();
            int j2 = mc.displayHeight - 80;
            int k2 = mc.displayHeight - 160;
            mc.fontRendererObj.drawString("30", 2, k2 + 1, -8947849);
            mc.fontRendererObj.drawString("30", 1, k2, -3881788);
            mc.fontRendererObj.drawString("60", 2, j2 + 1, -8947849);
            mc.fontRendererObj.drawString("60", 1, j2, -3881788);
            GlStateManager.matrixMode(5889);
            GlStateManager.popMatrix();
            GlStateManager.matrixMode(5888);
            GlStateManager.popMatrix();
            GlStateManager.enableTexture2D();
            float f1 = 1.0F - (float)((double)(System.currentTimeMillis() - memTimeStartMs) / 1000.0D);
            f1 = Config.limit(f1, 0.0F, 1.0F);
            int l2 = (int)(170.0F + f1 * 85.0F);
            int i1 = (int)(100.0F + f1 * 55.0F);
            int j1 = (int)(10.0F + f1 * 10.0F);
            int k1 = l2 << 16 | i1 << 8 | j1;
            int l1 = 512 / p_showLagometer_0_.getScaleFactor() + 2;
            int i2 = mc.displayHeight / p_showLagometer_0_.getScaleFactor() - 8;
            GuiIngame guiingame = mc.ingameGUI;
            GuiIngame.drawRect(l1 - 1, i2 - 1, l1 + 50, i2 + 10, -1605349296);
            mc.fontRendererObj.drawString(" " + memMbSec + " MB/s", l1, i2, k1);
            renderTimeNano = System.nanoTime() - i;
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:78,代码来源:Lagometer.java

示例12: renderItemOverlayIntoGUI

import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
/**
 * Renders the stack size and/or damage bar for the given ItemStack.
 */
public void renderItemOverlayIntoGUI(FontRenderer fr, ItemStack stack, int xPosition, int yPosition, String text)
{
    if (stack != null)
    {
        if (stack.stackSize != 1 || text != null)
        {
            String s = text == null ? String.valueOf(stack.stackSize) : text;

            if (text == null && stack.stackSize < 1)
            {
                s = EnumChatFormatting.RED + String.valueOf(stack.stackSize);
            }

            GlStateManager.disableLighting();
            GlStateManager.disableDepth();
            GlStateManager.disableBlend();
            fr.drawStringWithShadow(s, (float)(xPosition + 19 - 2 - fr.getStringWidth(s)), (float)(yPosition + 6 + 3), 16777215);
            GlStateManager.enableLighting();
            GlStateManager.enableDepth();
        }

        boolean flag = stack.isItemDamaged();

        if (Reflector.ForgeItem_showDurabilityBar.exists())
        {
            flag = Reflector.callBoolean(stack.getItem(), Reflector.ForgeItem_showDurabilityBar, new Object[] {stack});
        }

        if (flag)
        {
            int i = (int)Math.round(13.0D - (double)stack.getItemDamage() * 13.0D / (double)stack.getMaxDamage());
            int j = (int)Math.round(255.0D - (double)stack.getItemDamage() * 255.0D / (double)stack.getMaxDamage());

            if (Reflector.ForgeItem_getDurabilityForDisplay.exists())
            {
                double d0 = Reflector.callDouble(stack.getItem(), Reflector.ForgeItem_getDurabilityForDisplay, new Object[] {stack});
                i = (int)Math.round(13.0D - d0 * 13.0D);
                j = (int)Math.round(255.0D - d0 * 255.0D);
            }

            GlStateManager.disableLighting();
            GlStateManager.disableDepth();
            GlStateManager.disableTexture2D();
            GlStateManager.disableAlpha();
            GlStateManager.disableBlend();
            Tessellator tessellator = Tessellator.getInstance();
            WorldRenderer worldrenderer = tessellator.getWorldRenderer();
            this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, 13, 2, 0, 0, 0, 255);
            this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, 12, 1, (255 - j) / 4, 64, 0, 255);
            this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, i, 1, 255 - j, j, 0, 255);

            if (!Reflector.ForgeHooksClient.exists())
            {
                GlStateManager.enableBlend();
            }

            GlStateManager.enableAlpha();
            GlStateManager.enableTexture2D();
            GlStateManager.enableLighting();
            GlStateManager.enableDepth();
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:67,代码来源:RenderItem.java

示例13: renderPainting

import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
private void renderPainting(EntityPainting painting, int width, int height, int textureU, int textureV)
{
    float f = (float)(-width) / 2.0F;
    float f1 = (float)(-height) / 2.0F;
    float f2 = 0.5F;
    float f3 = 0.75F;
    float f4 = 0.8125F;
    float f5 = 0.0F;
    float f6 = 0.0625F;
    float f7 = 0.75F;
    float f8 = 0.8125F;
    float f9 = 0.001953125F;
    float f10 = 0.001953125F;
    float f11 = 0.7519531F;
    float f12 = 0.7519531F;
    float f13 = 0.0F;
    float f14 = 0.0625F;

    for (int i = 0; i < width / 16; ++i)
    {
        for (int j = 0; j < height / 16; ++j)
        {
            float f15 = f + (float)((i + 1) * 16);
            float f16 = f + (float)(i * 16);
            float f17 = f1 + (float)((j + 1) * 16);
            float f18 = f1 + (float)(j * 16);
            this.setLightmap(painting, (f15 + f16) / 2.0F, (f17 + f18) / 2.0F);
            float f19 = (float)(textureU + width - i * 16) / 256.0F;
            float f20 = (float)(textureU + width - (i + 1) * 16) / 256.0F;
            float f21 = (float)(textureV + height - j * 16) / 256.0F;
            float f22 = (float)(textureV + height - (j + 1) * 16) / 256.0F;
            Tessellator tessellator = Tessellator.getInstance();
            WorldRenderer worldrenderer = tessellator.getWorldRenderer();
            worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_NORMAL);
            worldrenderer.pos((double)f15, (double)f18, (double)(-f2)).tex((double)f20, (double)f21).normal(0.0F, 0.0F, -1.0F).endVertex();
            worldrenderer.pos((double)f16, (double)f18, (double)(-f2)).tex((double)f19, (double)f21).normal(0.0F, 0.0F, -1.0F).endVertex();
            worldrenderer.pos((double)f16, (double)f17, (double)(-f2)).tex((double)f19, (double)f22).normal(0.0F, 0.0F, -1.0F).endVertex();
            worldrenderer.pos((double)f15, (double)f17, (double)(-f2)).tex((double)f20, (double)f22).normal(0.0F, 0.0F, -1.0F).endVertex();
            worldrenderer.pos((double)f15, (double)f17, (double)f2).tex((double)f3, (double)f5).normal(0.0F, 0.0F, 1.0F).endVertex();
            worldrenderer.pos((double)f16, (double)f17, (double)f2).tex((double)f4, (double)f5).normal(0.0F, 0.0F, 1.0F).endVertex();
            worldrenderer.pos((double)f16, (double)f18, (double)f2).tex((double)f4, (double)f6).normal(0.0F, 0.0F, 1.0F).endVertex();
            worldrenderer.pos((double)f15, (double)f18, (double)f2).tex((double)f3, (double)f6).normal(0.0F, 0.0F, 1.0F).endVertex();
            worldrenderer.pos((double)f15, (double)f17, (double)(-f2)).tex((double)f7, (double)f9).normal(0.0F, 1.0F, 0.0F).endVertex();
            worldrenderer.pos((double)f16, (double)f17, (double)(-f2)).tex((double)f8, (double)f9).normal(0.0F, 1.0F, 0.0F).endVertex();
            worldrenderer.pos((double)f16, (double)f17, (double)f2).tex((double)f8, (double)f10).normal(0.0F, 1.0F, 0.0F).endVertex();
            worldrenderer.pos((double)f15, (double)f17, (double)f2).tex((double)f7, (double)f10).normal(0.0F, 1.0F, 0.0F).endVertex();
            worldrenderer.pos((double)f15, (double)f18, (double)f2).tex((double)f7, (double)f9).normal(0.0F, -1.0F, 0.0F).endVertex();
            worldrenderer.pos((double)f16, (double)f18, (double)f2).tex((double)f8, (double)f9).normal(0.0F, -1.0F, 0.0F).endVertex();
            worldrenderer.pos((double)f16, (double)f18, (double)(-f2)).tex((double)f8, (double)f10).normal(0.0F, -1.0F, 0.0F).endVertex();
            worldrenderer.pos((double)f15, (double)f18, (double)(-f2)).tex((double)f7, (double)f10).normal(0.0F, -1.0F, 0.0F).endVertex();
            worldrenderer.pos((double)f15, (double)f17, (double)f2).tex((double)f12, (double)f13).normal(-1.0F, 0.0F, 0.0F).endVertex();
            worldrenderer.pos((double)f15, (double)f18, (double)f2).tex((double)f12, (double)f14).normal(-1.0F, 0.0F, 0.0F).endVertex();
            worldrenderer.pos((double)f15, (double)f18, (double)(-f2)).tex((double)f11, (double)f14).normal(-1.0F, 0.0F, 0.0F).endVertex();
            worldrenderer.pos((double)f15, (double)f17, (double)(-f2)).tex((double)f11, (double)f13).normal(-1.0F, 0.0F, 0.0F).endVertex();
            worldrenderer.pos((double)f16, (double)f17, (double)(-f2)).tex((double)f12, (double)f13).normal(1.0F, 0.0F, 0.0F).endVertex();
            worldrenderer.pos((double)f16, (double)f18, (double)(-f2)).tex((double)f12, (double)f14).normal(1.0F, 0.0F, 0.0F).endVertex();
            worldrenderer.pos((double)f16, (double)f18, (double)f2).tex((double)f11, (double)f14).normal(1.0F, 0.0F, 0.0F).endVertex();
            worldrenderer.pos((double)f16, (double)f17, (double)f2).tex((double)f11, (double)f13).normal(1.0F, 0.0F, 0.0F).endVertex();
            tessellator.draw();
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:63,代码来源:RenderPainting.java

示例14: loadShader

import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
public void loadShader(float p_148042_1_)
{
    this.preLoadShader();
    this.framebufferIn.unbindFramebuffer();
    float f = (float)this.framebufferOut.framebufferTextureWidth;
    float f1 = (float)this.framebufferOut.framebufferTextureHeight;
    GlStateManager.viewport(0, 0, (int)f, (int)f1);
    this.manager.addSamplerTexture("DiffuseSampler", this.framebufferIn);

    for (int i = 0; i < this.listAuxFramebuffers.size(); ++i)
    {
        this.manager.addSamplerTexture((String)this.listAuxNames.get(i), this.listAuxFramebuffers.get(i));
        this.manager.getShaderUniformOrDefault("AuxSize" + i).set((float)((Integer)this.listAuxWidths.get(i)).intValue(), (float)((Integer)this.listAuxHeights.get(i)).intValue());
    }

    this.manager.getShaderUniformOrDefault("ProjMat").set(this.projectionMatrix);
    this.manager.getShaderUniformOrDefault("InSize").set((float)this.framebufferIn.framebufferTextureWidth, (float)this.framebufferIn.framebufferTextureHeight);
    this.manager.getShaderUniformOrDefault("OutSize").set(f, f1);
    this.manager.getShaderUniformOrDefault("Time").set(p_148042_1_);
    Minecraft minecraft = Minecraft.getMinecraft();
    this.manager.getShaderUniformOrDefault("ScreenSize").set((float)minecraft.displayWidth, (float)minecraft.displayHeight);
    this.manager.useShader();
    this.framebufferOut.framebufferClear();
    this.framebufferOut.bindFramebuffer(false);
    GlStateManager.depthMask(false);
    GlStateManager.colorMask(true, true, true, true);
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
    worldrenderer.pos(0.0D, (double)f1, 500.0D).color(255, 255, 255, 255).endVertex();
    worldrenderer.pos((double)f, (double)f1, 500.0D).color(255, 255, 255, 255).endVertex();
    worldrenderer.pos((double)f, 0.0D, 500.0D).color(255, 255, 255, 255).endVertex();
    worldrenderer.pos(0.0D, 0.0D, 500.0D).color(255, 255, 255, 255).endVertex();
    tessellator.draw();
    GlStateManager.depthMask(true);
    GlStateManager.colorMask(true, true, true, true);
    this.manager.endShader();
    this.framebufferOut.unbindFramebuffer();
    this.framebufferIn.unbindFramebufferTexture();

    for (Object object : this.listAuxFramebuffers)
    {
        if (object instanceof Framebuffer)
        {
            ((Framebuffer)object).unbindFramebufferTexture();
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:49,代码来源:Shader.java

示例15: renderEntityOnFire

import net.minecraft.client.renderer.Tessellator; //导入方法依赖的package包/类
/**
 * Renders fire on top of the entity. Args: entity, x, y, z, partialTickTime
 */
private void renderEntityOnFire(Entity entity, double x, double y, double z, float partialTicks)
{
    GlStateManager.disableLighting();
    TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks();
    TextureAtlasSprite textureatlassprite = texturemap.getAtlasSprite("minecraft:blocks/fire_layer_0");
    TextureAtlasSprite textureatlassprite1 = texturemap.getAtlasSprite("minecraft:blocks/fire_layer_1");
    GlStateManager.pushMatrix();
    GlStateManager.translate((float)x, (float)y, (float)z);
    float f = entity.width * 1.4F;
    GlStateManager.scale(f, f, f);
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    float f1 = 0.5F;
    float f2 = 0.0F;
    float f3 = entity.height / f;
    float f4 = (float)(entity.posY - entity.getEntityBoundingBox().minY);
    GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GlStateManager.translate(0.0F, 0.0F, -0.3F + (float)((int)f3) * 0.02F);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    float f5 = 0.0F;
    int i = 0;
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);

    while (f3 > 0.0F)
    {
        TextureAtlasSprite textureatlassprite2 = i % 2 == 0 ? textureatlassprite : textureatlassprite1;
        this.bindTexture(TextureMap.locationBlocksTexture);
        float f6 = textureatlassprite2.getMinU();
        float f7 = textureatlassprite2.getMinV();
        float f8 = textureatlassprite2.getMaxU();
        float f9 = textureatlassprite2.getMaxV();

        if (i / 2 % 2 == 0)
        {
            float f10 = f8;
            f8 = f6;
            f6 = f10;
        }

        worldrenderer.pos((double)(f1 - f2), (double)(0.0F - f4), (double)f5).tex((double)f8, (double)f9).endVertex();
        worldrenderer.pos((double)(-f1 - f2), (double)(0.0F - f4), (double)f5).tex((double)f6, (double)f9).endVertex();
        worldrenderer.pos((double)(-f1 - f2), (double)(1.4F - f4), (double)f5).tex((double)f6, (double)f7).endVertex();
        worldrenderer.pos((double)(f1 - f2), (double)(1.4F - f4), (double)f5).tex((double)f8, (double)f7).endVertex();
        f3 -= 0.45F;
        f4 -= 0.45F;
        f1 *= 0.9F;
        f5 += 0.03F;
        ++i;
    }

    tessellator.draw();
    GlStateManager.popMatrix();
    GlStateManager.enableLighting();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:58,代码来源:Render.java


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