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


Java RenderHelper.enableStandardItemLighting方法代碼示例

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


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

示例1: drawItem

import net.minecraft.client.renderer.RenderHelper; //導入方法依賴的package包/類
protected void drawItem(ItemStack stack, int x, int y) {

		GlStateManager.color(1, 1, 1, 1);
        GlStateManager.translate(0.0F, 0.0F, 32.0F);
        GlStateManager.disableLighting();
        GlStateManager.enableDepth();
        
        RenderHelper.disableStandardItemLighting();
        RenderHelper.enableGUIStandardItemLighting();
        
        this.zLevel = 200.0F;
        this.itemRender.zLevel = 200.0F;
        net.minecraft.client.gui.FontRenderer font = null;
        if (stack != null) font = stack.getItem().getFontRenderer(stack);
        if (font == null) font = fontRendererObj;
        this.itemRender.renderItemAndEffectIntoGUI(stack, x, y);
        this.itemRender.renderItemOverlayIntoGUI(font, stack, x, y, null);
        this.zLevel = 0.0F;
        this.itemRender.zLevel = 0.0F;
        
        RenderHelper.enableStandardItemLighting();
        GlStateManager.enableLighting();
        GlStateManager.disableDepth();
	}
 
開發者ID:astronautlabs,項目名稱:rezolve,代碼行數:25,代碼來源:GuiContainerBase.java

示例2: doRenderLayer

import net.minecraft.client.renderer.RenderHelper; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
@Override
public void doRenderLayer(AbstractClientPlayer entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
    if (!Arrays.asList(contributors.uuid).contains(entitylivingbaseIn.getUniqueID().toString())) return;
    if (!entitylivingbaseIn.isWearing(EnumPlayerModelParts.CAPE)) return;
    GlStateManager.pushMatrix();
    GlStateManager.enableBlend();
    GlStateManager.disableCull();
    RenderHelper.disableStandardItemLighting();
    if (Minecraft.isAmbientOcclusionEnabled()) {
        GlStateManager.shadeModel(GL11.GL_SMOOTH);
    } else {
        GlStateManager.shadeModel(GL11.GL_FLAT);
    }
    GlStateManager.translate(0, -0.015f, 0);
    if (!entitylivingbaseIn.inventory.armorInventory.get(3).isEmpty()) GlStateManager.translate(0, -0.02f, 0);
    if (entitylivingbaseIn.isSneaking()) GlStateManager.translate(0, 0.27, 0);
    GlStateManager.rotate(90, 0, 1, 0);
    GlStateManager.rotate(180, 1, 0, 0);
    GlStateManager.rotate(netHeadYaw, 0, -1, 0);
    GlStateManager.rotate(headPitch, 0, 0, -1);

    Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    Calendar calendar = Calendar.getInstance();
    if (calendar.get(Calendar.MONTH) == Calendar.OCTOBER) {
        spookyScarySkeletons();
    } else if (calendar.get(Calendar.MONTH) == Calendar.DECEMBER) {
        itsSnowyHere();
    } else {
        Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightnessColor(ClientProxy.ears_baked, 0.5f, 255, 255, 255);
    }
    RenderHelper.enableStandardItemLighting();
    GlStateManager.depthMask(true);
    GlStateManager.popMatrix();
}
 
開發者ID:Buuz135,項目名稱:Industrial-Foregoing,代碼行數:36,代碼來源:ContributorsCatEarsRender.java

示例3: rotateArroundXAndY

import net.minecraft.client.renderer.RenderHelper; //導入方法依賴的package包/類
private static void rotateArroundXAndY(float angle, float angleY) {
	GlStateManager.pushMatrix();
	GlStateManager.rotate(angle, 1.0F, 0.0F, 0.0F);
	GlStateManager.rotate(angleY, 0.0F, 1.0F, 0.0F);
	RenderHelper.enableStandardItemLighting();
	GlStateManager.popMatrix();
}
 
開發者ID:the-realest-stu,項目名稱:Etheric,代碼行數:8,代碼來源:SeeingStoneHandler.java

示例4: drawEntityOnScreen

import net.minecraft.client.renderer.RenderHelper; //導入方法依賴的package包/類
/**
 * Draws the entity to the screen. Args: xPos, yPos, scale, mouseX, mouseY, entityLiving
 */
public static void drawEntityOnScreen(int posX, int posY, int scale, float mouseX, float mouseY, EntityLivingBase ent)
{
    GlStateManager.enableColorMaterial();
    GlStateManager.pushMatrix();
    GlStateManager.translate((float)posX, (float)posY, 50.0F);
    GlStateManager.scale((float)(-scale), (float)scale, (float)scale);
    GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
    float f = ent.renderYawOffset;
    float f1 = ent.rotationYaw;
    float f2 = ent.rotationPitch;
    float f3 = ent.prevRotationYawHead;
    float f4 = ent.rotationYawHead;
    GlStateManager.rotate(135.0F, 0.0F, 1.0F, 0.0F);
    RenderHelper.enableStandardItemLighting();
    GlStateManager.rotate(-135.0F, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(-((float)Math.atan((double)(mouseY / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F);
    ent.renderYawOffset = (float)Math.atan((double)(mouseX / 40.0F)) * 20.0F;
    ent.rotationYaw = (float)Math.atan((double)(mouseX / 40.0F)) * 40.0F;
    ent.rotationPitch = -((float)Math.atan((double)(mouseY / 40.0F))) * 20.0F;
    ent.rotationYawHead = ent.rotationYaw;
    ent.prevRotationYawHead = ent.rotationYaw;
    GlStateManager.translate(0.0F, 0.0F, 0.0F);
    RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
    rendermanager.setPlayerViewY(180.0F);
    rendermanager.setRenderShadow(false);
    rendermanager.renderEntityWithPosYaw(ent, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
    rendermanager.setRenderShadow(true);
    ent.renderYawOffset = f;
    ent.rotationYaw = f1;
    ent.rotationPitch = f2;
    ent.prevRotationYawHead = f3;
    ent.rotationYawHead = f4;
    GlStateManager.popMatrix();
    RenderHelper.disableStandardItemLighting();
    GlStateManager.disableRescaleNormal();
    GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
    GlStateManager.disableTexture2D();
    GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:43,代碼來源:GuiInventory.java

示例5: renderCrystalBeams

import net.minecraft.client.renderer.RenderHelper; //導入方法依賴的package包/類
public static void renderCrystalBeams(double p_188325_0_, double p_188325_2_, double p_188325_4_, float p_188325_6_, double p_188325_7_, double p_188325_9_, double p_188325_11_, int p_188325_13_, double p_188325_14_, double p_188325_16_, double p_188325_18_)
{
    float f = (float)(p_188325_14_ - p_188325_7_);
    float f1 = (float)(p_188325_16_ - 1.0D - p_188325_9_);
    float f2 = (float)(p_188325_18_ - p_188325_11_);
    float f3 = MathHelper.sqrt(f * f + f2 * f2);
    float f4 = MathHelper.sqrt(f * f + f1 * f1 + f2 * f2);
    GlStateManager.pushMatrix();
    GlStateManager.translate((float)p_188325_0_, (float)p_188325_2_ + 2.0F, (float)p_188325_4_);
    GlStateManager.rotate((float)(-Math.atan2((double)f2, (double)f)) * (180F / (float)Math.PI) - 90.0F, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate((float)(-Math.atan2((double)f3, (double)f1)) * (180F / (float)Math.PI) - 90.0F, 1.0F, 0.0F, 0.0F);
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    RenderHelper.disableStandardItemLighting();
    GlStateManager.disableCull();
    GlStateManager.shadeModel(7425);
    float f5 = 0.0F - ((float)p_188325_13_ + p_188325_6_) * 0.01F;
    float f6 = MathHelper.sqrt(f * f + f1 * f1 + f2 * f2) / 32.0F - ((float)p_188325_13_ + p_188325_6_) * 0.01F;
    vertexbuffer.begin(5, DefaultVertexFormats.POSITION_TEX_COLOR);
    int i = 8;

    for (int j = 0; j <= 8; ++j)
    {
        float f7 = MathHelper.sin((float)(j % 8) * ((float)Math.PI * 2F) / 8.0F) * 0.75F;
        float f8 = MathHelper.cos((float)(j % 8) * ((float)Math.PI * 2F) / 8.0F) * 0.75F;
        float f9 = (float)(j % 8) / 8.0F;
        vertexbuffer.pos((double)(f7 * 0.2F), (double)(f8 * 0.2F), 0.0D).tex((double)f9, (double)f5).color(0, 0, 0, 255).endVertex();
        vertexbuffer.pos((double)f7, (double)f8, (double)f4).tex((double)f9, (double)f6).color(255, 255, 255, 255).endVertex();
    }

    tessellator.draw();
    GlStateManager.enableCull();
    GlStateManager.shadeModel(7424);
    RenderHelper.enableStandardItemLighting();
    GlStateManager.popMatrix();
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:37,代碼來源:RenderDragon.java

示例6: renderTileEntityAt

import net.minecraft.client.renderer.RenderHelper; //導入方法依賴的package包/類
@Override
public final void renderTileEntityAt(T te, double x, double y, double z, float partialTicks, int destroyStage)
{
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer VertexBuffer = tessellator.getBuffer();
    this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    RenderHelper.disableStandardItemLighting();
    GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GlStateManager.enableBlend();
    GlStateManager.disableCull();

    if (Minecraft.isAmbientOcclusionEnabled())
    {
        GlStateManager.shadeModel(GL11.GL_SMOOTH);
    }
    else
    {
        GlStateManager.shadeModel(GL11.GL_FLAT);
    }

    VertexBuffer.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);

    renderTileEntityFast(te, x, y, z, partialTicks, destroyStage, VertexBuffer);
    VertexBuffer.setTranslation(0, 0, 0);

    tessellator.draw();

    RenderHelper.enableStandardItemLighting();
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:30,代碼來源:FastTESR.java

示例7: setXItemLighting

import net.minecraft.client.renderer.RenderHelper; //導入方法依賴的package包/類
private static void setXItemLighting() {
    RenderHelper.enableStandardItemLighting();
}
 
開發者ID:NSExceptional,項目名稱:Zombe-Modpack,代碼行數:4,代碼來源:ZWrapper.java

示例8: doRender

import net.minecraft.client.renderer.RenderHelper; //導入方法依賴的package包/類
/**
 * Renders the desired {@code T} type Entity.
 */
public void doRender(EntityXPOrb entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    if (!this.renderOutlines)
    {
        GlStateManager.pushMatrix();
        GlStateManager.translate((float)x, (float)y, (float)z);
        this.bindEntityTexture(entity);
        RenderHelper.enableStandardItemLighting();
        int i = entity.getTextureByXP();
        float f = (float)(i % 4 * 16 + 0) / 64.0F;
        float f1 = (float)(i % 4 * 16 + 16) / 64.0F;
        float f2 = (float)(i / 4 * 16 + 0) / 64.0F;
        float f3 = (float)(i / 4 * 16 + 16) / 64.0F;
        float f4 = 1.0F;
        float f5 = 0.5F;
        float f6 = 0.25F;
        int j = entity.getBrightnessForRender(partialTicks);
        int k = j % 65536;
        int l = j / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)k, (float)l);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        float f8 = 255.0F;
        float f9 = ((float)entity.xpColor + partialTicks) / 2.0F;
        l = (int)((MathHelper.sin(f9 + 0.0F) + 1.0F) * 0.5F * 255.0F);
        int i1 = 255;
        int j1 = (int)((MathHelper.sin(f9 + 4.1887903F) + 1.0F) * 0.1F * 255.0F);
        GlStateManager.translate(0.0F, 0.1F, 0.0F);
        GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
        GlStateManager.rotate((float)(this.renderManager.options.thirdPersonView == 2 ? -1 : 1) * -this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
        float f7 = 0.3F;
        GlStateManager.scale(0.3F, 0.3F, 0.3F);
        Tessellator tessellator = Tessellator.getInstance();
        VertexBuffer vertexbuffer = tessellator.getBuffer();
        vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
        vertexbuffer.pos(-0.5D, -0.25D, 0.0D).tex((double)f, (double)f3).color(l, 255, j1, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
        vertexbuffer.pos(0.5D, -0.25D, 0.0D).tex((double)f1, (double)f3).color(l, 255, j1, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
        vertexbuffer.pos(0.5D, 0.75D, 0.0D).tex((double)f1, (double)f2).color(l, 255, j1, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
        vertexbuffer.pos(-0.5D, 0.75D, 0.0D).tex((double)f, (double)f2).color(l, 255, j1, 128).normal(0.0F, 1.0F, 0.0F).endVertex();
        tessellator.draw();
        GlStateManager.disableBlend();
        GlStateManager.disableRescaleNormal();
        GlStateManager.popMatrix();
        super.doRender(entity, x, y, z, entityYaw, partialTicks);
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:49,代碼來源:RenderXPOrb.java

示例9: render

import net.minecraft.client.renderer.RenderHelper; //導入方法依賴的package包/類
public void render( double x, double y, double z)
{
    if(child==null)
    {
        parent.connectionLines.remove(this);
        return;
    }

    GlStateManager.pushMatrix();
    GlStateManager.pushAttrib();
    //if(dim!=Minecraft.getMinecraft().theWorld.provider.getDimension())return;
    Minecraft.getMinecraft().getTextureManager().bindTexture(this.type.texture);
    Tessellator tessellator = Tessellator.getInstance();
    //tessellator.getBuffer().setTranslation(x,y,x);
    GlStateManager.translate(x,y,z);

    GL11.glEnable(GL11.GL_BLEND);
    GlStateManager.enableAlpha();

    //long angle = (System.currentTimeMillis() / 10) % 360;
    //GlStateManager.translate(0, 0.07 * Math.sin(Math.PI * angle / 180), 0);
    //GlStateManager.rotate(-angle, 1, 1, 1);

    GlStateManager.rotate(180, 1, 0, 0);


    RenderHelper.disableStandardItemLighting();

    GlStateManager.translate(0.33D*parent.x+0.1666,-0.08,-0.33D*parent.z-0.1666);
    GlStateManager.rotate(90+(float)heading, 0, 1, 0);


    if (Minecraft.isAmbientOcclusionEnabled()) {
        GlStateManager.shadeModel(GL11.GL_SMOOTH);
    } else {
        GlStateManager.shadeModel(GL11.GL_FLAT);
    }
    //GlStateManager.translate(-(pX+cX)/2,-(pY+cY)/2+0.5,-(pZ+cZ)/2);

    Color newColor = new Color(this.parent.getSignal().type.color);

    tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
    int state = (int)(System.currentTimeMillis()/100)%4+1;
    tessellator.getBuffer().pos(width/2,0,0).tex(0.25D*state,length).color(newColor.getRed(),newColor.getGreen(),newColor.getBlue(),newColor.getAlpha()).endVertex();
    tessellator.getBuffer().pos(width/2,0,length).tex(0.25D*state,0).color(newColor.getRed(),newColor.getGreen(),newColor.getBlue(),newColor.getAlpha()).endVertex();
    tessellator.getBuffer().pos(-width/2,0,length).tex(0.25D*(state-1),0).color(newColor.getRed(),newColor.getGreen(),newColor.getBlue(),newColor.getAlpha()).endVertex();
    tessellator.getBuffer().pos(-width/2,0,0).tex(0.25D*(state-1),length).color(newColor.getRed(),newColor.getGreen(),newColor.getBlue(),newColor.getAlpha()).endVertex();
    tessellator.draw();

    GL11.glDisable(GL11.GL_BLEND);
    RenderHelper.enableStandardItemLighting();
    GlStateManager.popMatrix();
    GlStateManager.popAttrib();

}
 
開發者ID:Drazuam,項目名稱:RunicArcana,代碼行數:56,代碼來源:DustConnectionLine.java

示例10: doRender_NeutralBeam

import net.minecraft.client.renderer.RenderHelper; //導入方法依賴的package包/類
public void doRender_NeutralBeam(_ProjectileBase entity, double x, double y, double z, float yaw, float tick, float beamWidth) 
  {
  	//GL11.glPushMatrix();
  	
//float f2 = par9;// (float) player.innerRotation + par9;
float f3 = MathHelper.sin(tick * 0.2F) / 2.0F + 0.5F;
f3 = (f3 * f3 + f3) * 0.2F;

float xPosEnd = (float) (entity.ownerX - entity.posX - (entity.prevPosX - entity.posX) * (double) (1.0F - tick));
float yPosEnd = (float) ((double) f3 + entity.ownerY - entity.posY - (entity.prevPosY - entity.posY) * (double) (1.0F - tick));
float zPosEnd = (float) (entity.ownerZ - entity.posZ - (entity.prevPosZ - entity.posZ) * (double) (1.0F - tick));

//for rotation/distance
float f7 = MathHelper.sqrt_float(xPosEnd * xPosEnd + zPosEnd * zPosEnd);
float f8 = MathHelper.sqrt_float(xPosEnd * xPosEnd + yPosEnd * yPosEnd + zPosEnd * zPosEnd);

// Changing the starting point here slightly, so it doesn't come out of the center
//int distance = 6;	// Increasing this will likely increase the distance
//double adjustmentZ = -MathHelper.cos((entity.shootingEntity.rotationYaw) * (float)Math.PI / 180.0F) * (distance * 0.08);
//double adjustmentX = MathHelper.sin((entity.shootingEntity.rotationYaw) * (float)Math.PI / 180.0F) * (distance * 0.08);

// Start drawing (i think)
GL11.glTranslated((float) x, (float) y, (float) z);	// Adjusted with distance to shooter
GL11.glRotatef((float) (-Math.atan2((double) zPosEnd, (double) xPosEnd)) * 180.0F / (float) Math.PI - 90.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef((float) (-Math.atan2((double) f7, (double) yPosEnd)) * 180.0F / (float) Math.PI - 90.0F, 1.0F, 0.0F, 0.0F);
Tessellator tessellator = Tessellator.instance;

//Makes the beam look nice
RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL11.GL_CULL_FACE);

//Shading?
GL11.glShadeModel(GL11.GL_SMOOTH);

//from what i can tell f9 and f10 make the beam change (looks like its rotating or whatnot)
float f9 = 0.0F - ((float) entity.ticksExisted + tick) * 0.01F;
float f10 = MathHelper.sqrt_float(xPosEnd * xPosEnd + yPosEnd * yPosEnd + zPosEnd * zPosEnd) / 32.0F - ((float) entity.ticksExisted + tick) * 0.01F;

// change draw mode
tessellator.startDrawing(5);
byte b0 = 8;	// how many sides the circle has?

//float beamWidth = 0.15f;

for (int i = 0; i <= b0; ++i) 	// makes one side circular(fancy math stuff)
{
       float f11 = MathHelper.sin((float) (i % b0) * (float) Math.PI * 2.0F / (float) b0) * beamWidth;		// "changing the 2 or .75 should change size of circle"
       float f12 = MathHelper.cos((float) (i % b0) * (float) Math.PI * 2.0F / (float) b0) * beamWidth;		// The 2 seems to be there to describe a full circle
       float f13 = (float) (i % b0) * 1.0F / (float) b0;												// 1 makes it a half circle
       tessellator.setColorOpaque_I(0);
       tessellator.addVertexWithUV((double) (f11 * 0.2F), (double) (f12 * 0.2F), 0.0D, (double) f13, (double) f10);	// Now how do I shorten the beam slightly
       tessellator.setColorOpaque_I(16777215);																			// so it doesn't appear from the center of the shooter
       tessellator.addVertexWithUV((double) f11, (double) f12, (double) f8, (double) f13, (double) f9);				
}

tessellator.draw();	// draw added vertices
  
// reset openGl stuff?
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glShadeModel(GL11.GL_FLAT);
RenderHelper.enableStandardItemLighting();
  	
  	GL11.glPopMatrix();
  }
 
開發者ID:Domochevsky,項目名稱:minecraft-quiverbow,代碼行數:65,代碼來源:Render_Projectile.java

示例11: renderPapers

import net.minecraft.client.renderer.RenderHelper; //導入方法依賴的package包/類
private void renderPapers(ItemStack stack, int slot, TileEntityWritingDesk te)
{
	if (stack != null && !stack.isEmpty())
	{
		RenderHelper.enableStandardItemLighting();
		GlStateManager.enableLighting();
		GlStateManager.pushMatrix();
		GlStateManager.translate(0.75, .8, 0.5);
		GlStateManager.scale(.5f, .5f, .5f);
		GlStateManager.disableLighting();
		GlStateManager.disableCull();
		Minecraft.getMinecraft().getTextureManager()
				.bindTexture(new ResourceLocation(ArcaneMagic.MODID, "textures/misc/parchment.png"));
		Tessellator tessellator = Tessellator.getInstance();
		BufferBuilder bufferbuilder = tessellator.getBuffer();
		GlStateManager.translate(-0.5F, -0.5F, 0.0F);
		//GlStateManager.rotate(te.getAge(), 0,1,0);
		bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX);
		bufferbuilder.pos(0, 0, -0.4).tex(0.0D, 1.0D).endVertex();
		bufferbuilder.pos(0, 0, 0.4).tex(1.0D, 1.0D).endVertex();
		bufferbuilder.pos(0, 0.8, 0.4).tex(1.0D, 0.0D).endVertex();
		bufferbuilder.pos(0, 0.8, -0.4).tex(0.0D, 0.0D).endVertex();
		tessellator.draw();

		GlStateManager.rotate(180, 0, 0, 1);
		GlStateManager.rotate(90, 0, 1, 0);
		GlStateManager.translate(0, -0.59, 0);
		GlStateManager.translate(0, 0, -0.0005);

		for (int side = 0; side < 2; side++)
		{
			if (side == 1)
			{
				GlStateManager.translate(0, 0, 0.001);
				GlStateManager.rotate(180, 0, 1, 0);
				//GlStateManager.rotate(180,0,0,1);

			}
			GlStateManager.pushMatrix();
			GlStateManager.pushAttrib();
			GlStateManager.scale(0.008, 0.008, 0.008);

			GLHelper.drawCenteredSplitString(Minecraft.getMinecraft().fontRenderer, "Manipulation Magic", 0, -15,
					100, 0x000000);

			GlStateManager.popAttrib();
			GlStateManager.popMatrix();

			GlStateManager.pushMatrix();
			GlStateManager.pushAttrib();
			GlStateManager.scale(0.005, 0.005, 0.005);
			GLHelper.drawCenteredSplitString(Minecraft.getMinecraft().fontRenderer,
					"Manipulating Anima directly would be a powerful ability, if only you could obtain the right items to learn how.\n\nLuckily, your new discoveries should aid you greatly in this process.",
					0, 0, 130, 0x000000);
			GlStateManager.popAttrib();
			GlStateManager.popMatrix();
		}
		GlStateManager.popMatrix();
	}
}
 
開發者ID:raphydaphy,項目名稱:ArcaneMagic,代碼行數:61,代碼來源:WritingDeskTESR.java

示例12: doRenderLayer

import net.minecraft.client.renderer.RenderHelper; //導入方法依賴的package包/類
public void doRenderLayer(EntityDragon entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
    if (entitylivingbaseIn.deathTicks > 0)
    {
        Tessellator tessellator = Tessellator.getInstance();
        WorldRenderer worldrenderer = tessellator.getWorldRenderer();
        RenderHelper.disableStandardItemLighting();
        float f = ((float)entitylivingbaseIn.deathTicks + partialTicks) / 200.0F;
        float f1 = 0.0F;

        if (f > 0.8F)
        {
            f1 = (f - 0.8F) / 0.2F;
        }

        Random random = new Random(432L);
        GlStateManager.disableTexture2D();
        GlStateManager.shadeModel(7425);
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(770, 1);
        GlStateManager.disableAlpha();
        GlStateManager.enableCull();
        GlStateManager.depthMask(false);
        GlStateManager.pushMatrix();
        GlStateManager.translate(0.0F, -1.0F, -2.0F);

        for (int i = 0; (float)i < (f + f * f) / 2.0F * 60.0F; ++i)
        {
            GlStateManager.rotate(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
            GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
            GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F);
            GlStateManager.rotate(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
            GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
            GlStateManager.rotate(random.nextFloat() * 360.0F + f * 90.0F, 0.0F, 0.0F, 1.0F);
            float f2 = random.nextFloat() * 20.0F + 5.0F + f1 * 10.0F;
            float f3 = random.nextFloat() * 2.0F + 1.0F + f1 * 2.0F;
            worldrenderer.begin(6, DefaultVertexFormats.POSITION_COLOR);
            worldrenderer.pos(0.0D, 0.0D, 0.0D).color(255, 255, 255, (int)(255.0F * (1.0F - f1))).endVertex();
            worldrenderer.pos(-0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex();
            worldrenderer.pos(0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex();
            worldrenderer.pos(0.0D, (double)f2, (double)(1.0F * f3)).color(255, 0, 255, 0).endVertex();
            worldrenderer.pos(-0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex();
            tessellator.draw();
        }

        GlStateManager.popMatrix();
        GlStateManager.depthMask(true);
        GlStateManager.disableCull();
        GlStateManager.disableBlend();
        GlStateManager.shadeModel(7424);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        GlStateManager.enableTexture2D();
        GlStateManager.enableAlpha();
        RenderHelper.enableStandardItemLighting();
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:57,代碼來源:LayerEnderDragonDeath.java

示例13: renderTileEntityAt

import net.minecraft.client.renderer.RenderHelper; //導入方法依賴的package包/類
public void renderTileEntityAt(TileEntityPiston te, double x, double y, double z, float partialTicks, int destroyStage)
{
    BlockPos blockpos = te.getPos();
    IBlockState iblockstate = te.getPistonState();
    Block block = iblockstate.getBlock();

    if (block.getMaterial() != Material.air && te.getProgress(partialTicks) < 1.0F)
    {
        Tessellator tessellator = Tessellator.getInstance();
        WorldRenderer worldrenderer = tessellator.getWorldRenderer();
        this.bindTexture(TextureMap.locationBlocksTexture);
        RenderHelper.disableStandardItemLighting();
        GlStateManager.blendFunc(770, 771);
        GlStateManager.enableBlend();
        GlStateManager.disableCull();

        if (Minecraft.isAmbientOcclusionEnabled())
        {
            GlStateManager.shadeModel(7425);
        }
        else
        {
            GlStateManager.shadeModel(7424);
        }

        worldrenderer.begin(7, DefaultVertexFormats.BLOCK);
        worldrenderer.setTranslation((double)((float)x - (float)blockpos.getX() + te.getOffsetX(partialTicks)), (double)((float)y - (float)blockpos.getY() + te.getOffsetY(partialTicks)), (double)((float)z - (float)blockpos.getZ() + te.getOffsetZ(partialTicks)));
        World world = this.getWorld();

        if (block == Blocks.piston_head && te.getProgress(partialTicks) < 0.5F)
        {
            iblockstate = iblockstate.withProperty(BlockPistonExtension.SHORT, Boolean.valueOf(true));
            this.blockRenderer.getBlockModelRenderer().renderModel(world, this.blockRenderer.getModelFromBlockState(iblockstate, world, blockpos), iblockstate, blockpos, worldrenderer, true);
        }
        else if (te.shouldPistonHeadBeRendered() && !te.isExtending())
        {
            BlockPistonExtension.EnumPistonType blockpistonextension$enumpistontype = block == Blocks.sticky_piston ? BlockPistonExtension.EnumPistonType.STICKY : BlockPistonExtension.EnumPistonType.DEFAULT;
            IBlockState iblockstate1 = Blocks.piston_head.getDefaultState().withProperty(BlockPistonExtension.TYPE, blockpistonextension$enumpistontype).withProperty(BlockPistonExtension.FACING, iblockstate.getValue(BlockPistonBase.FACING));
            iblockstate1 = iblockstate1.withProperty(BlockPistonExtension.SHORT, Boolean.valueOf(te.getProgress(partialTicks) >= 0.5F));
            this.blockRenderer.getBlockModelRenderer().renderModel(world, this.blockRenderer.getModelFromBlockState(iblockstate1, world, blockpos), iblockstate1, blockpos, worldrenderer, true);
            worldrenderer.setTranslation((double)((float)x - (float)blockpos.getX()), (double)((float)y - (float)blockpos.getY()), (double)((float)z - (float)blockpos.getZ()));
            iblockstate.withProperty(BlockPistonBase.EXTENDED, Boolean.valueOf(true));
            this.blockRenderer.getBlockModelRenderer().renderModel(world, this.blockRenderer.getModelFromBlockState(iblockstate, world, blockpos), iblockstate, blockpos, worldrenderer, true);
        }
        else
        {
            this.blockRenderer.getBlockModelRenderer().renderModel(world, this.blockRenderer.getModelFromBlockState(iblockstate, world, blockpos), iblockstate, blockpos, worldrenderer, false);
        }

        worldrenderer.setTranslation(0.0D, 0.0D, 0.0D);
        tessellator.draw();
        RenderHelper.enableStandardItemLighting();
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:55,代碼來源:TileEntityPistonRenderer.java

示例14: drawScreen

import net.minecraft.client.renderer.RenderHelper; //導入方法依賴的package包/類
/**
 * Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks
 */
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
    super.drawScreen(mouseX, mouseY, partialTicks);
    MerchantRecipeList merchantrecipelist = this.merchant.getRecipes(this.mc.thePlayer);

    if (merchantrecipelist != null && !merchantrecipelist.isEmpty())
    {
        int i = (this.width - this.xSize) / 2;
        int j = (this.height - this.ySize) / 2;
        int k = this.selectedMerchantRecipe;
        MerchantRecipe merchantrecipe = (MerchantRecipe)merchantrecipelist.get(k);
        ItemStack itemstack = merchantrecipe.getItemToBuy();
        ItemStack itemstack1 = merchantrecipe.getSecondItemToBuy();
        ItemStack itemstack2 = merchantrecipe.getItemToSell();
        GlStateManager.pushMatrix();
        RenderHelper.enableGUIStandardItemLighting();
        GlStateManager.disableLighting();
        GlStateManager.enableRescaleNormal();
        GlStateManager.enableColorMaterial();
        GlStateManager.enableLighting();
        this.itemRender.zLevel = 100.0F;
        this.itemRender.renderItemAndEffectIntoGUI(itemstack, i + 36, j + 24);
        this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack, i + 36, j + 24);

        if (itemstack1 != null)
        {
            this.itemRender.renderItemAndEffectIntoGUI(itemstack1, i + 62, j + 24);
            this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack1, i + 62, j + 24);
        }

        this.itemRender.renderItemAndEffectIntoGUI(itemstack2, i + 120, j + 24);
        this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack2, i + 120, j + 24);
        this.itemRender.zLevel = 0.0F;
        GlStateManager.disableLighting();

        if (this.isPointInRegion(36, 24, 16, 16, mouseX, mouseY) && itemstack != null)
        {
            this.renderToolTip(itemstack, mouseX, mouseY);
        }
        else if (itemstack1 != null && this.isPointInRegion(62, 24, 16, 16, mouseX, mouseY) && itemstack1 != null)
        {
            this.renderToolTip(itemstack1, mouseX, mouseY);
        }
        else if (itemstack2 != null && this.isPointInRegion(120, 24, 16, 16, mouseX, mouseY) && itemstack2 != null)
        {
            this.renderToolTip(itemstack2, mouseX, mouseY);
        }
        else if (merchantrecipe.isRecipeDisabled() && (this.isPointInRegion(83, 21, 28, 21, mouseX, mouseY) || this.isPointInRegion(83, 51, 28, 21, mouseX, mouseY)))
        {
            this.drawCreativeTabHoveringText(I18n.format("merchant.deprecated", new Object[0]), mouseX, mouseY);
        }

        GlStateManager.popMatrix();
        GlStateManager.enableLighting();
        GlStateManager.enableDepth();
        RenderHelper.enableStandardItemLighting();
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:62,代碼來源:GuiMerchant.java

示例15: drawHoveringText

import net.minecraft.client.renderer.RenderHelper; //導入方法依賴的package包/類
/**
 * Draws a List of strings as a tooltip. Every entry is drawn on a seperate line.
 */
protected void drawHoveringText(List<String> textLines, int x, int y)
{
    if (!textLines.isEmpty())
    {
        GlStateManager.disableRescaleNormal();
        RenderHelper.disableStandardItemLighting();
        GlStateManager.disableLighting();
        GlStateManager.disableDepth();
        int i = 0;

        for (String s : textLines)
        {
            int j = this.fontRendererObj.getStringWidth(s);

            if (j > i)
            {
                i = j;
            }
        }

        int l1 = x + 12;
        int i2 = y - 12;
        int k = 8;

        if (textLines.size() > 1)
        {
            k += 2 + (textLines.size() - 1) * 10;
        }

        if (l1 + i > this.width)
        {
            l1 -= 28 + i;
        }

        if (i2 + k + 6 > this.height)
        {
            i2 = this.height - k - 6;
        }

        this.zLevel = 300.0F;
        this.itemRender.zLevel = 300.0F;
        int l = -267386864;
        this.drawGradientRect(l1 - 3, i2 - 4, l1 + i + 3, i2 - 3, l, l);
        this.drawGradientRect(l1 - 3, i2 + k + 3, l1 + i + 3, i2 + k + 4, l, l);
        this.drawGradientRect(l1 - 3, i2 - 3, l1 + i + 3, i2 + k + 3, l, l);
        this.drawGradientRect(l1 - 4, i2 - 3, l1 - 3, i2 + k + 3, l, l);
        this.drawGradientRect(l1 + i + 3, i2 - 3, l1 + i + 4, i2 + k + 3, l, l);
        int i1 = 1347420415;
        int j1 = (i1 & 16711422) >> 1 | i1 & -16777216;
        this.drawGradientRect(l1 - 3, i2 - 3 + 1, l1 - 3 + 1, i2 + k + 3 - 1, i1, j1);
        this.drawGradientRect(l1 + i + 2, i2 - 3 + 1, l1 + i + 3, i2 + k + 3 - 1, i1, j1);
        this.drawGradientRect(l1 - 3, i2 - 3, l1 + i + 3, i2 - 3 + 1, i1, i1);
        this.drawGradientRect(l1 - 3, i2 + k + 2, l1 + i + 3, i2 + k + 3, j1, j1);

        for (int k1 = 0; k1 < textLines.size(); ++k1)
        {
            String s1 = (String)textLines.get(k1);
            this.fontRendererObj.drawStringWithShadow(s1, (float)l1, (float)i2, -1);

            if (k1 == 0)
            {
                i2 += 2;
            }

            i2 += 10;
        }

        this.zLevel = 0.0F;
        this.itemRender.zLevel = 0.0F;
        GlStateManager.enableLighting();
        GlStateManager.enableDepth();
        RenderHelper.enableStandardItemLighting();
        GlStateManager.enableRescaleNormal();
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:79,代碼來源:GuiScreen.java


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