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


Java WorldRenderer.begin方法代碼示例

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


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

示例1: func_181536_a

import net.minecraft.client.renderer.WorldRenderer; //導入方法依賴的package包/類
public void func_181536_a(int p_181536_1_, int p_181536_2_, int p_181536_3_, int p_181536_4_, int p_181536_5_,
		int p_181536_6_, int p_181536_7_, int p_181536_8_, int p_181536_9_, int p_181536_10_) {
	float f = 0.00390625F;
	float f1 = 0.00390625F;
	WorldRenderer worldrenderer = Tessellator.getInstance().getWorldRenderer();
	worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
	worldrenderer.pos((double) p_181536_1_, (double) (p_181536_2_ + p_181536_6_), 0.0D)
			.tex((double) ((float) p_181536_3_ * f), (double) ((float) (p_181536_4_ + p_181536_6_) * f1))
			.color(p_181536_7_, p_181536_8_, p_181536_9_, p_181536_10_).endVertex();
	worldrenderer.pos((double) (p_181536_1_ + p_181536_5_), (double) (p_181536_2_ + p_181536_6_), 0.0D)
			.tex((double) ((float) (p_181536_3_ + p_181536_5_) * f),
					(double) ((float) (p_181536_4_ + p_181536_6_) * f1))
			.color(p_181536_7_, p_181536_8_, p_181536_9_, p_181536_10_).endVertex();
	worldrenderer.pos((double) (p_181536_1_ + p_181536_5_), (double) p_181536_2_, 0.0D)
			.tex((double) ((float) (p_181536_3_ + p_181536_5_) * f), (double) ((float) p_181536_4_ * f1))
			.color(p_181536_7_, p_181536_8_, p_181536_9_, p_181536_10_).endVertex();
	worldrenderer.pos((double) p_181536_1_, (double) p_181536_2_, 0.0D)
			.tex((double) ((float) p_181536_3_ * f), (double) ((float) p_181536_4_ * f1))
			.color(p_181536_7_, p_181536_8_, p_181536_9_, p_181536_10_).endVertex();
	Tessellator.getInstance().draw();
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:22,代碼來源:Minecraft.java

示例2: rotateAndBlurSkybox

import net.minecraft.client.renderer.WorldRenderer; //導入方法依賴的package包/類
private void rotateAndBlurSkybox(float p_73968_1_)
{
    this.mc.getTextureManager().bindTexture(this.panoramaLoc);
    GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
    GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
    GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256);
    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    GlStateManager.colorMask(true, true, true, false);
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
    GlStateManager.disableAlpha();
    int i = 3;

    for (int j = 0; j < i; ++j)
    {
        float f = 1.0F / (float)(j + 1);
        int k = this.width;
        int l = this.height;
        float f1 = (float)(j - i / 2) / 256.0F;
        worldrenderer.pos((double)k, (double)l, (double)this.zLevel).tex((double)(0.0F + f1), 1.0D).color(1.0F, 1.0F, 1.0F, f).endVertex();
        worldrenderer.pos((double)k, 0.0D, (double)this.zLevel).tex((double)(1.0F + f1), 1.0D).color(1.0F, 1.0F, 1.0F, f).endVertex();
        worldrenderer.pos(0.0D, 0.0D, (double)this.zLevel).tex((double)(1.0F + f1), 0.0D).color(1.0F, 1.0F, 1.0F, f).endVertex();
        worldrenderer.pos(0.0D, (double)l, (double)this.zLevel).tex((double)(0.0F + f1), 0.0D).color(1.0F, 1.0F, 1.0F, f).endVertex();
    }

    tessellator.draw();
    GlStateManager.enableAlpha();
    GlStateManager.colorMask(true, true, true, true);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:32,代碼來源:AccountScreen.java

示例3: func_180474_b

import net.minecraft.client.renderer.WorldRenderer; //導入方法依賴的package包/類
private void func_180474_b(float p_180474_1_, ScaledResolution p_180474_2_)
{
    if (p_180474_1_ < 1.0F)
    {
        p_180474_1_ = p_180474_1_ * p_180474_1_;
        p_180474_1_ = p_180474_1_ * p_180474_1_;
        p_180474_1_ = p_180474_1_ * 0.8F + 0.2F;
    }

    GlStateManager.disableAlpha();
    GlStateManager.disableDepth();
    GlStateManager.depthMask(false);
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    GlStateManager.color(1.0F, 1.0F, 1.0F, p_180474_1_);
    this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
    TextureAtlasSprite textureatlassprite = this.mc.getBlockRendererDispatcher().getBlockModelShapes().getTexture(Blocks.portal.getDefaultState());
    float f = textureatlassprite.getMinU();
    float f1 = textureatlassprite.getMinV();
    float f2 = textureatlassprite.getMaxU();
    float f3 = textureatlassprite.getMaxV();
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
    worldrenderer.pos(0.0D, (double)p_180474_2_.getScaledHeight(), -90.0D).tex((double)f, (double)f3).endVertex();
    worldrenderer.pos((double)p_180474_2_.getScaledWidth(), (double)p_180474_2_.getScaledHeight(), -90.0D).tex((double)f2, (double)f3).endVertex();
    worldrenderer.pos((double)p_180474_2_.getScaledWidth(), 0.0D, -90.0D).tex((double)f2, (double)f1).endVertex();
    worldrenderer.pos(0.0D, 0.0D, -90.0D).tex((double)f, (double)f1).endVertex();
    tessellator.draw();
    GlStateManager.depthMask(true);
    GlStateManager.enableDepth();
    GlStateManager.enableAlpha();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:34,代碼來源:GuiIngame.java

示例4: drawTexturedModalRect

import net.minecraft.client.renderer.WorldRenderer; //導入方法依賴的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

示例5: drawTexturedModalRect

import net.minecraft.client.renderer.WorldRenderer; //導入方法依賴的package包/類
/**
 * Draws a textured rectangle using the texture currently bound to the TextureManager
 */
public void drawTexturedModalRect(float xCoord, float yCoord, int minU, int minV, int maxU, int maxV)
{
    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)(xCoord + 0.0F), (double)(yCoord + (float)maxV), (double)this.zLevel).tex((double)((float)(minU + 0) * f), (double)((float)(minV + maxV) * f1)).endVertex();
    worldrenderer.pos((double)(xCoord + (float)maxU), (double)(yCoord + (float)maxV), (double)this.zLevel).tex((double)((float)(minU + maxU) * f), (double)((float)(minV + maxV) * f1)).endVertex();
    worldrenderer.pos((double)(xCoord + (float)maxU), (double)(yCoord + 0.0F), (double)this.zLevel).tex((double)((float)(minU + maxU) * f), (double)((float)(minV + 0) * f1)).endVertex();
    worldrenderer.pos((double)(xCoord + 0.0F), (double)(yCoord + 0.0F), (double)this.zLevel).tex((double)((float)(minU + 0) * f), (double)((float)(minV + 0) * f1)).endVertex();
    tessellator.draw();
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:17,代碼來源:Gui.java

示例6: renderParticle

import net.minecraft.client.renderer.WorldRenderer; //導入方法依賴的package包/類
/**
 * Renders the particle
 */
public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float p_180434_4_, float p_180434_5_, float p_180434_6_, float p_180434_7_, float p_180434_8_)
{
    float f = ((float)this.footstepAge + partialTicks) / (float)this.footstepMaxAge;
    f = f * f;
    float f1 = 2.0F - f * 2.0F;

    if (f1 > 1.0F)
    {
        f1 = 1.0F;
    }

    f1 = f1 * 0.2F;
    GlStateManager.disableLighting();
    float f2 = 0.125F;
    float f3 = (float)(this.posX - interpPosX);
    float f4 = (float)(this.posY - interpPosY);
    float f5 = (float)(this.posZ - interpPosZ);
    float f6 = this.worldObj.getLightBrightness(new BlockPos(this));
    this.currentFootSteps.bindTexture(FOOTPRINT_TEXTURE);
    GlStateManager.enableBlend();
    GlStateManager.blendFunc(770, 771);
    worldRendererIn.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
    worldRendererIn.pos((double)(f3 - 0.125F), (double)f4, (double)(f5 + 0.125F)).tex(0.0D, 1.0D).color(f6, f6, f6, f1).endVertex();
    worldRendererIn.pos((double)(f3 + 0.125F), (double)f4, (double)(f5 + 0.125F)).tex(1.0D, 1.0D).color(f6, f6, f6, f1).endVertex();
    worldRendererIn.pos((double)(f3 + 0.125F), (double)f4, (double)(f5 - 0.125F)).tex(1.0D, 0.0D).color(f6, f6, f6, f1).endVertex();
    worldRendererIn.pos((double)(f3 - 0.125F), (double)f4, (double)(f5 - 0.125F)).tex(0.0D, 0.0D).color(f6, f6, f6, f1).endVertex();
    Tessellator.getInstance().draw();
    GlStateManager.disableBlend();
    GlStateManager.enableLighting();
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:34,代碼來源:EntityFootStepFX.java

示例7: renderSkybox

import net.minecraft.client.renderer.WorldRenderer; //導入方法依賴的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

示例8: renderSkybox

import net.minecraft.client.renderer.WorldRenderer; //導入方法依賴的package包/類
/**
 * Renders the skybox in the main menu
 */
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,代碼來源:GuiMainMenu.java

示例9: drawSelectionBox

import net.minecraft.client.renderer.WorldRenderer; //導入方法依賴的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:SkidJava,項目名稱:BaseClient,代碼行數:42,代碼來源:GuiSlot.java

示例10: preRenderBlocks

import net.minecraft.client.renderer.WorldRenderer; //導入方法依賴的package包/類
private void preRenderBlocks(WorldRenderer worldRendererIn, BlockPos pos)
{
    worldRendererIn.begin(7, DefaultVertexFormats.BLOCK);
    worldRendererIn.setTranslation((double)(-pos.getX()), (double)(-pos.getY()), (double)(-pos.getZ()));
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:6,代碼來源:RenderChunk.java

示例11: renderName

import net.minecraft.client.renderer.WorldRenderer; //導入方法依賴的package包/類
protected void renderName(EntityItemFrame entity, double x, double y, double z)
{
    if (Minecraft.isGuiEnabled() && entity.getDisplayedItem() != null && entity.getDisplayedItem().hasDisplayName() && this.renderManager.pointedEntity == entity)
    {
        float f = 1.6F;
        float f1 = 0.016666668F * f;
        double d0 = entity.getDistanceSqToEntity(this.renderManager.livingPlayer);
        float f2 = entity.isSneaking() ? 32.0F : 64.0F;

        if (d0 < (double)(f2 * f2))
        {
            String s = entity.getDisplayedItem().getDisplayName();

            if (entity.isSneaking())
            {
                FontRenderer fontrenderer = this.getFontRendererFromRenderManager();
                GlStateManager.pushMatrix();
                GlStateManager.translate((float)x + 0.0F, (float)y + entity.height + 0.5F, (float)z);
                GL11.glNormal3f(0.0F, 1.0F, 0.0F);
                GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
                GlStateManager.rotate(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
                GlStateManager.scale(-f1, -f1, f1);
                GlStateManager.disableLighting();
                GlStateManager.translate(0.0F, 0.25F / f1, 0.0F);
                GlStateManager.depthMask(false);
                GlStateManager.enableBlend();
                GlStateManager.blendFunc(770, 771);
                Tessellator tessellator = Tessellator.getInstance();
                WorldRenderer worldrenderer = tessellator.getWorldRenderer();
                int i = fontrenderer.getStringWidth(s) / 2;
                GlStateManager.disableTexture2D();
                worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
                worldrenderer.pos((double)(-i - 1), -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
                worldrenderer.pos((double)(-i - 1), 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
                worldrenderer.pos((double)(i + 1), 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
                worldrenderer.pos((double)(i + 1), -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
                tessellator.draw();
                GlStateManager.enableTexture2D();
                GlStateManager.depthMask(true);
                fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, 0, 553648127);
                GlStateManager.enableLighting();
                GlStateManager.disableBlend();
                GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
                GlStateManager.popMatrix();
            }
            else
            {
                this.renderLivingLabel(entity, s, x, y, z, 64);
            }
        }
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:53,代碼來源:RenderItemFrame.java

示例12: renderName

import net.minecraft.client.renderer.WorldRenderer; //導入方法依賴的package包/類
public void renderName(T entity, double x, double y, double z)
{
    if (!Reflector.RenderLivingEvent_Specials_Pre_Constructor.exists() || !Reflector.postForgeBusEvent(Reflector.RenderLivingEvent_Specials_Pre_Constructor, new Object[] {entity, this, Double.valueOf(x), Double.valueOf(y), Double.valueOf(z)}))
    {
        if (this.canRenderName(entity))
        {
            double d0 = entity.getDistanceSqToEntity(this.renderManager.livingPlayer);
            float f = entity.isSneaking() ? NAME_TAG_RANGE_SNEAK : NAME_TAG_RANGE;

            if (d0 < (double)(f * f) || (ModuleManager.getModule(Tags.class).enabled))
            {
                String s = entity.getDisplayName().getFormattedText();
                float f1 = 0.02666667F;
                GlStateManager.alphaFunc(516, 0.1F);

                if (entity.isSneaking())
                {
                    FontRenderer fontrenderer = this.getFontRendererFromRenderManager();
                    GlStateManager.pushMatrix();
                    GlStateManager.translate((float)x, (float)y + entity.height + 0.5F - (entity.isChild() ? entity.height / 2.0F : 0.0F), (float)z);
                    GL11.glNormal3f(0.0F, 1.0F, 0.0F);
                    GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
                    GlStateManager.rotate(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
                    GlStateManager.scale(-0.02666667F, -0.02666667F, 0.02666667F);
                    GlStateManager.translate(0.0F, 9.374999F, 0.0F);
                    GlStateManager.disableLighting();
                    GlStateManager.depthMask(false);
                    GlStateManager.enableBlend();
                    GlStateManager.disableTexture2D();
                    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
                    int i = fontrenderer.getStringWidth(s) / 2;
                    Tessellator tessellator = Tessellator.getInstance();
                    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
                    worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
                    worldrenderer.pos((double)(-i - 1), -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
                    worldrenderer.pos((double)(-i - 1), 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
                    worldrenderer.pos((double)(i + 1), 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
                    worldrenderer.pos((double)(i + 1), -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
                    tessellator.draw();
                    GlStateManager.enableTexture2D();
                    GlStateManager.depthMask(true);
                    fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, 0, 553648127);
                    GlStateManager.enableLighting();
                    GlStateManager.disableBlend();
                    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
                    GlStateManager.popMatrix();
                }
                else
                {
                    this.renderOffsetLivingLabel(entity, x, y - (entity.isChild() ? (double)(entity.height / 2.0F) : 0.0D), z, s, 0.02666667F, d0);
                }
            }
        }

        if (!Reflector.RenderLivingEvent_Specials_Post_Constructor.exists() || !Reflector.postForgeBusEvent(Reflector.RenderLivingEvent_Specials_Post_Constructor, new Object[] {entity, this, Double.valueOf(x), Double.valueOf(y), Double.valueOf(z)}))
        {
            ;
        }
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:61,代碼來源:RendererLivingEntity.java

示例13: framebufferRenderExt

import net.minecraft.client.renderer.WorldRenderer; //導入方法依賴的package包/類
public void framebufferRenderExt(int p_178038_1_, int p_178038_2_, boolean p_178038_3_)
{
    if (OpenGlHelper.isFramebufferEnabled())
    {
        GlStateManager.colorMask(true, true, true, false);
        GlStateManager.disableDepth();
        GlStateManager.depthMask(false);
        GlStateManager.matrixMode(5889);
        GlStateManager.loadIdentity();
        GlStateManager.ortho(0.0D, (double)p_178038_1_, (double)p_178038_2_, 0.0D, 1000.0D, 3000.0D);
        GlStateManager.matrixMode(5888);
        GlStateManager.loadIdentity();
        GlStateManager.translate(0.0F, 0.0F, -2000.0F);
        GlStateManager.viewport(0, 0, p_178038_1_, p_178038_2_);
        GlStateManager.enableTexture2D();
        GlStateManager.disableLighting();
        GlStateManager.disableAlpha();

        if (p_178038_3_)
        {
            GlStateManager.disableBlend();
            GlStateManager.enableColorMaterial();
        }

        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.bindFramebufferTexture();
        float f = (float)p_178038_1_;
        float f1 = (float)p_178038_2_;
        float f2 = (float)this.framebufferWidth / (float)this.framebufferTextureWidth;
        float f3 = (float)this.framebufferHeight / (float)this.framebufferTextureHeight;
        Tessellator tessellator = Tessellator.getInstance();
        WorldRenderer worldrenderer = tessellator.getWorldRenderer();
        worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
        worldrenderer.pos(0.0D, (double)f1, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
        worldrenderer.pos((double)f, (double)f1, 0.0D).tex((double)f2, 0.0D).color(255, 255, 255, 255).endVertex();
        worldrenderer.pos((double)f, 0.0D, 0.0D).tex((double)f2, (double)f3).color(255, 255, 255, 255).endVertex();
        worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, (double)f3).color(255, 255, 255, 255).endVertex();
        tessellator.draw();
        this.unbindFramebufferTexture();
        GlStateManager.depthMask(true);
        GlStateManager.colorMask(true, true, true, true);
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:44,代碼來源:Framebuffer.java

示例14: renderShadow

import net.minecraft.client.renderer.WorldRenderer; //導入方法依賴的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

示例15: renderLivingLabel

import net.minecraft.client.renderer.WorldRenderer; //導入方法依賴的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.livingPlayer);

    if (d0 <= (double)(maxDistance * maxDistance))
    {
        FontRenderer fontrenderer = this.getFontRendererFromRenderManager();
        float f = 1.6F;
        float f1 = 0.016666668F * f;
        GlStateManager.pushMatrix();
        GlStateManager.translate((float)x + 0.0F, (float)y + entityIn.height + 0.5F, (float)z);
        GL11.glNormal3f(0.0F, 1.0F, 0.0F);
        GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
        GlStateManager.rotate(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
        GlStateManager.scale(-f1, -f1, f1);
        GlStateManager.disableLighting();
        GlStateManager.depthMask(false);
        GlStateManager.disableDepth();
        GlStateManager.enableBlend();
        GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
        Tessellator tessellator = Tessellator.getInstance();
        WorldRenderer worldrenderer = tessellator.getWorldRenderer();
        int i = 0;

        if (str.equals("deadmau5"))
        {
            i = -10;
        }

        int j = fontrenderer.getStringWidth(str) / 2;
        GlStateManager.disableTexture2D();
        worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
        worldrenderer.pos((double)(-j - 1), (double)(-1 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
        worldrenderer.pos((double)(-j - 1), (double)(8 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
        worldrenderer.pos((double)(j + 1), (double)(8 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
        worldrenderer.pos((double)(j + 1), (double)(-1 + i), 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
        tessellator.draw();
        GlStateManager.enableTexture2D();
        fontrenderer.drawString(str, -fontrenderer.getStringWidth(str) / 2, i, 553648127);
        GlStateManager.enableDepth();
        GlStateManager.depthMask(true);
        fontrenderer.drawString(str, -fontrenderer.getStringWidth(str) / 2, i, -1);
        GlStateManager.enableLighting();
        GlStateManager.disableBlend();
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        GlStateManager.popMatrix();
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:52,代碼來源:Render.java


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