Search in sources :

Example 1 with TextureManager

use of net.minecraft.client.renderer.texture.TextureManager in project BetterStorage by copygirl.

the class TileEntityPresentRenderer method renderTileEntityAt.

public void renderTileEntityAt(TileEntityPresent present, double x, double y, double z, float partialTicks) {
    TextureManager texMan = Minecraft.getMinecraft().getTextureManager();
    GL11.glPushMatrix();
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glTranslated(x + 0.5, y, z + 0.5);
    texMan.bindTexture(texMan.getResourceLocation(0));
    renderSome(present.colorInner, 1);
    renderSome(present.colorOuter, (present.skojanzaMode ? new int[] { 2, 3 } : new int[] { 2 }));
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glDepthFunc(GL11.GL_EQUAL);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    texMan.bindTexture(Resources.texturePresentOverlay);
    model.render(1);
    GL11.glDepthFunc(GL11.GL_LEQUAL);
    GL11.glDisable(GL11.GL_BLEND);
    EntityPlayer player = Minecraft.getMinecraft().thePlayer;
    if ((present.nameTag != null) && (present.getWorldObj() != null) && (player != null) && (player.getDistanceSq(present.xCoord + 0.5, present.yCoord + 0.5, present.zCoord + 0.5) < NAMETAG_RENDER_RANGE_SQ)) {
        MovingObjectPosition o = Minecraft.getMinecraft().objectMouseOver;
        renderNameTag(present.nameTag, player.getCommandSenderName().equalsIgnoreCase(present.nameTag), ((o.blockX == present.xCoord) && (o.blockY == present.yCoord) && (o.blockZ == present.zCoord)));
    }
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glPopMatrix();
}
Also used : TextureManager(net.minecraft.client.renderer.texture.TextureManager) MovingObjectPosition(net.minecraft.util.MovingObjectPosition) EntityPlayer(net.minecraft.entity.player.EntityPlayer)

Example 2 with TextureManager

use of net.minecraft.client.renderer.texture.TextureManager in project BetterStorage by copygirl.

the class RenderUtils method renderItemIn3d.

public static void renderItemIn3d(ItemStack stack) {
    TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();
    // Not sure why but this can be null when the world loads.
    if (textureManager == null)
        return;
    Item item = stack.getItem();
    GL11.glPushMatrix();
    Tessellator tessellator = Tessellator.instance;
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glTranslatef(-0.5F, -0.5F, 1 / 32.0F);
    int passes = item.getRenderPasses(stack.getItemDamage());
    for (int pass = 0; pass < passes; pass++) {
        textureManager.bindTexture(((stack.getItemSpriteNumber() == 0) ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture));
        IIcon icon = item.getIcon(stack, pass);
        float minU = icon.getMinU();
        float maxU = icon.getMaxU();
        float minV = icon.getMinV();
        float maxV = icon.getMaxV();
        RenderUtils.setColorFromInt(item.getColorFromItemStack(stack, pass));
        ItemRenderer.renderItemIn2D(tessellator, maxU, minV, minU, maxV, icon.getIconWidth(), icon.getIconHeight(), 0.0625F);
    }
    if (stack.hasEffect(0)) {
        GL11.glDepthFunc(GL11.GL_EQUAL);
        GL11.glDisable(GL11.GL_LIGHTING);
        textureManager.bindTexture(glint);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
        float f7 = 0.76F;
        GL11.glColor4f(0.5F * f7, 0.25F * f7, 0.8F * f7, 1.0F);
        GL11.glMatrixMode(GL11.GL_TEXTURE);
        GL11.glPushMatrix();
        float f8 = 0.125F;
        GL11.glScalef(f8, f8, f8);
        float f9 = Minecraft.getSystemTime() % 3000L / 3000.0F * 8.0F;
        GL11.glTranslatef(f9, 0.0F, 0.0F);
        GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
        ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F);
        GL11.glPopMatrix();
        GL11.glPushMatrix();
        GL11.glScalef(f8, f8, f8);
        f9 = Minecraft.getSystemTime() % 4873L / 4873.0F * 8.0F;
        GL11.glTranslatef(-f9, 0.0F, 0.0F);
        GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
        ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F);
        GL11.glPopMatrix();
        GL11.glMatrixMode(GL11.GL_MODELVIEW);
        GL11.glDisable(GL11.GL_BLEND);
        GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glDepthFunc(GL11.GL_LEQUAL);
    }
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glPopMatrix();
}
Also used : Item(net.minecraft.item.Item) TextureManager(net.minecraft.client.renderer.texture.TextureManager) Tessellator(net.minecraft.client.renderer.Tessellator) IIcon(net.minecraft.util.IIcon)

Example 3 with TextureManager

use of net.minecraft.client.renderer.texture.TextureManager in project PneumaticCraft by MineMaarten.

the class RenderLaser method render.

public void render(float partialTicks, double x1, double y1, double z1, double x2, double y2, double z2) {
    Minecraft mc = FMLClientHandler.instance().getClient();
    TextureManager textureManager = mc.renderEngine;
    double laserLength = PneumaticCraftUtils.distBetween(x1, y1, z1, x2, y2, z2);
    double laserSize = 0.4;
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_CULL_FACE);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glTranslated(x1, y1, z1);
    double dx = x2 - x1;
    double dy = y2 - y1;
    double dz = z2 - z1;
    float f3 = MathHelper.sqrt_double(dx * dx + dz * dz);
    double rotYaw = Math.atan2(dx, dz) * 180.0D / Math.PI;
    double rotPitch = 90 - (float) (Math.atan2(dy, f3) * 180.0D / Math.PI);
    GL11.glRotated(rotYaw, 0, 1, 0);
    GL11.glRotated(rotPitch, 1, 0, 0);
    GL11.glScaled(laserSize, laserSize, laserSize);
    GL11.glTranslated(0, 0.6, 0);
    GL11.glRotated((ticksExisted + partialTicks) * 200, 0, 1, 0);
    GL11.glPushMatrix();
    GL11.glScaled(1, laserLength / laserSize, 1);
    /*   GL11.glTranslated(0, -0.01, 0);
           textureManager.bindTexture(Textures.RENDER_LASER_ANIMATION);
           renderAnimation(partialTicks, laserLength / laserSize);
           GL11.glTranslated(0, 0.01, 0);*/
    textureManager.bindTexture(Textures.RENDER_LASER);
    renderQuad(glowColor);
    textureManager.bindTexture(Textures.RENDER_LASER_OVERLAY);
    renderQuad(coreColor);
    GL11.glPopMatrix();
    GL11.glRotated(180, 1, 0, 0);
    textureManager.bindTexture(Textures.RENDER_LASER_START);
    renderQuad(glowColor);
    textureManager.bindTexture(Textures.RENDER_LASER_START_OVERLAY);
    renderQuad(coreColor);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glColor4d(1, 1, 1, 1);
}
Also used : TextureManager(net.minecraft.client.renderer.texture.TextureManager) Minecraft(net.minecraft.client.Minecraft)

Example 4 with TextureManager

use of net.minecraft.client.renderer.texture.TextureManager in project ImmersiveEngineering by BluSunrize.

the class ClientUtils method drawBlockDamageTexture.

//	public static void handleStaticTileRenderer(TileEntity tile)
//	{
//		handleStaticTileRenderer(tile,true);
//	}
//	public static void handleStaticTileRenderer(TileEntity tile, boolean translate)
//	{
//		TileEntitySpecialRenderer tesr = TileEntityRendererDispatcher.instance.getSpecialRenderer(tile);
//		if(tesr instanceof TileRenderIE)
//		{
//			Matrix4 matrixT = new Matrix4();
//			if(translate)
//				matrixT.translate(tile.xCoord, tile.yCoord, tile.zCoord);
//			((TileRenderIE)tesr).renderStatic(tile, Tessellator.instance, matrixT, new Matrix4());
//		}
//	}
//
//	public static void renderStaticWavefrontModel(TileEntity tile, WavefrontObject model, Tessellator tes, Matrix4 translationMatrix, Matrix4 rotationMatrix, int offsetLighting, boolean invertFaces, String... renderedParts) {
//		renderStaticWavefrontModel(tile, model, tes, translationMatrix, rotationMatrix, offsetLighting, invertFaces, 1, 1, 1, renderedParts);
//	}
//
//	/**
//	 * A big "Thank you!" to AtomicBlom and Rorax for helping me figure this one out =P
//	 */
//	public static void renderStaticWavefrontModel(TileEntity tile, WavefrontObject model, Tessellator tes, Matrix4 translationMatrix, Matrix4 rotationMatrix, int offsetLighting, boolean invertFaces, float colR, float colG, float colB, String... renderedParts)
//	{
//		renderStaticWavefrontModel(tile.getWorldObj(),tile.xCoord,tile.yCoord,tile.zCoord, model, tes, translationMatrix, rotationMatrix, offsetLighting, invertFaces, colR,colG,colB, renderedParts);
//	}
//	public static void renderStaticWavefrontModel(IBlockAccess world, int x, int y, int z, WavefrontObject model, Tessellator tes, Matrix4 translationMatrix, Matrix4 rotationMatrix, int offsetLighting, boolean invertFaces, float colR, float colG, float colB, String... renderedParts)
//	{
//		if(world!=null)
//		{
//			int lb = world.getLightBrightnessForSkyBlocks(x, y, z, 0);
//			int lb_j = lb % 65536;
//			int lb_k = lb / 65536;
//			OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)lb_j / 1.0F, (float)lb_k / 1.0F);
//		}
//		Vertex vertexCopy = new Vertex(0,0,0);
//		Vertex normalCopy = new Vertex(0,0,0);
//
//		for(GroupObject groupObject : model.groupObjects)
//		{
//			boolean render = false;
//			if(renderedParts==null || renderedParts.length<1)
//				render = true;
//			else
//				for(String s : renderedParts)
//					if(groupObject.name.equalsIgnoreCase(s))
//						render = true;
//			if(render)
//				for(Face face : groupObject.faces)
//				{
//					if(face.faceNormal == null)
//						face.faceNormal = face.calculateFaceNormal();
//
//					normalCopy.x = face.faceNormal.x;
//					normalCopy.y = face.faceNormal.y;
//					normalCopy.z = face.faceNormal.z;
//					rotationMatrix.apply(normalCopy);
//					float biggestNormal = Math.max(Math.abs(normalCopy.y), Math.max(Math.abs(normalCopy.x),Math.abs(normalCopy.z)));
//					int side = biggestNormal==Math.abs(normalCopy.y)?(normalCopy.y<0?0:1): biggestNormal==Math.abs(normalCopy.z)?(normalCopy.z<0?2:3): (normalCopy.x<0?4:5);
//
//					BlockLightingInfo faceLight = null;
//					if(offsetLighting==0 && world!=null)
//						faceLight = calculateBlockLighting(side, world, world.getBlock(x,y,z), x,y,z, colR,colG,colB, standardBlockAABB);
//					else if(offsetLighting==1 && world!=null)
//					{
//						double faceMinX = face.vertices[0].x;
//						double faceMinY = face.vertices[0].y;
//						double faceMinZ = face.vertices[0].z;
//						double faceMaxX = face.vertices[0].x;
//						double faceMaxY = face.vertices[0].y;
//						double faceMaxZ = face.vertices[0].z;
//						for(int i=1; i<face.vertices.length; ++i)
//						{
//							faceMinX = Math.min(faceMinX, face.vertices[i].x);
//							faceMinY = Math.min(faceMinY, face.vertices[i].y);
//							faceMinZ = Math.min(faceMinZ, face.vertices[i].z);
//							faceMaxX = Math.max(faceMaxX, face.vertices[i].x);
//							faceMaxY = Math.max(faceMaxY, face.vertices[i].y);
//							faceMaxZ = Math.max(faceMaxZ, face.vertices[i].z);
//						}
//						faceLight = calculateBlockLighting(side, world, world.getBlock(x, y, z), x,y,z, colR,colG,colB, AxisAlignedBB.getBoundingBox(faceMinX,faceMinY,faceMinZ, faceMaxX,faceMaxY,faceMaxZ));
//					}
//
//					tes.setNormal(face.faceNormal.x, face.faceNormal.y, face.faceNormal.z);
//
//					for(int i=0; i<face.vertices.length; ++i)
//					{
//						int target = !invertFaces?i:(face.vertices.length-1-i);
//						int corner = (int)(target/(float)face.vertices.length*4);
//						Vertex vertex = face.vertices[target];
//						vertexCopy.x = vertex.x;
//						vertexCopy.y = vertex.y;
//						vertexCopy.z = vertex.z;
//						rotationMatrix.apply(vertexCopy);
//						translationMatrix.apply(vertexCopy);
//						if(faceLight!=null)
//						{
//							tes.setBrightness(corner==0?faceLight.brightnessTopLeft: corner==1?faceLight.brightnessBottomLeft: corner==2?faceLight.brightnessBottomRight: faceLight.brightnessTopRight);
//							float r = corner==0?faceLight.colorRedTopLeft: corner==1?faceLight.colorRedBottomLeft: corner==2?faceLight.colorRedBottomRight: faceLight.colorRedTopRight;
//							float g = corner==0?faceLight.colorGreenTopLeft: corner==1?faceLight.colorGreenBottomLeft: corner==2?faceLight.colorGreenBottomRight: faceLight.colorGreenTopRight;
//							float b = corner==0?faceLight.colorBlueTopLeft: corner==1?faceLight.colorBlueBottomLeft: corner==2?faceLight.colorBlueBottomRight: faceLight.colorBlueTopRight;
//							tes.setColorOpaque_F(r, g, b);
//						}
//						else if(world!=null)
//						{
//							tes.setBrightness(0xb000b0);
//							tes.setColorOpaque_F(colR,colG,colB);
//						}
//
//						if(face.textureCoordinates!=null && face.textureCoordinates.length>0)
//						{
//							TextureCoordinate textureCoordinate = face.textureCoordinates[target];
//							tes.addVertexWithUV(vertexCopy.x, vertexCopy.y, vertexCopy.z, textureCoordinate.u, textureCoordinate.v);
//						}
//						else
//						{
//							tes.addVertex(vertexCopy.x, vertexCopy.y, vertexCopy.z);
//						}
//					}
//				}
//		}
//	}
//	public static void renderStaticWavefrontModelWithIcon(TileEntity tile, WavefrontObject model, IIcon icon, Tessellator tes, Matrix4 translationMatrix, Matrix4 rotationMatrix, int offsetLighting, boolean invertFaces, float colR, float colG, float colB, String... renderedParts)
//	{
//		renderStaticWavefrontModelWithIcon(tile.getWorldObj(),tile.xCoord,tile.yCoord,tile.zCoord, model, icon, tes, translationMatrix, rotationMatrix, offsetLighting, invertFaces, colR,colG,colB, renderedParts);
//	}
//	public static void renderStaticWavefrontModelWithIcon(IBlockAccess world, int x, int y, int z, WavefrontObject model, IIcon icon, Tessellator tes, Matrix4 translationMatrix, Matrix4 rotationMatrix, int offsetLighting, boolean invertFaces, float colR, float colG, float colB, String... renderedParts)
//	{
//		if(icon==null)
//			return;
//		if(world!=null)
//		{
//			int lb = world.getLightBrightnessForSkyBlocks(x, y, z, 0);
//			int lb_j = lb % 65536;
//			int lb_k = lb / 65536;
//			OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)lb_j / 1.0F, (float)lb_k / 1.0F);
//		}
//		Vertex normalCopy = new Vertex(0,0,0);
//
//		float minU = icon.getInterpolatedU(0);
//		float sizeU = icon.getInterpolatedU(16) - minU;
//		float minV = icon.getInterpolatedV(0);
//		float sizeV = icon.getInterpolatedV(16) - minV;
//		float baseOffsetU = (16f/icon.getIconWidth())*.0005F;
//		float baseOffsetV = (16f/icon.getIconHeight())*.0005F;
//
//		for(GroupObject groupObject : model.groupObjects)
//		{
//			boolean render = false;
//			if(renderedParts==null || renderedParts.length<1)
//				render = true;
//			else
//				for(String s : renderedParts)
//					if(groupObject.name.equalsIgnoreCase(s))
//						render = true;
//			if(render)
//				for(Face face : groupObject.faces)
//				{
//					if(face.faceNormal == null)
//						face.faceNormal = face.calculateFaceNormal();
//
//					normalCopy.x = face.faceNormal.x;
//					normalCopy.y = face.faceNormal.y;
//					normalCopy.z = face.faceNormal.z;
//					rotationMatrix.apply(normalCopy);
//					float biggestNormal = Math.max(Math.abs(normalCopy.y), Math.max(Math.abs(normalCopy.x),Math.abs(normalCopy.z)));
//					int side = biggestNormal==Math.abs(normalCopy.y)?(normalCopy.y<0?0:1): biggestNormal==Math.abs(normalCopy.z)?(normalCopy.z<0?2:3): (normalCopy.x<0?4:5);
//
//					BlockLightingInfo faceLight = null;
//					if(offsetLighting==0 && world!=null)
//						faceLight = calculateBlockLighting(side, world, world.getBlock(x,y,z), x,y,z, colR,colG,colB, standardBlockAABB);
//					else if(offsetLighting==1 && world!=null)
//					{
//						double faceMinX = face.vertices[0].x;
//						double faceMinY = face.vertices[0].y;
//						double faceMinZ = face.vertices[0].z;
//						double faceMaxX = face.vertices[0].x;
//						double faceMaxY = face.vertices[0].y;
//						double faceMaxZ = face.vertices[0].z;
//						for(int i=1; i<face.vertices.length; ++i)
//						{
//							faceMinX = Math.min(faceMinX, face.vertices[i].x);
//							faceMinY = Math.min(faceMinY, face.vertices[i].y);
//							faceMinZ = Math.min(faceMinZ, face.vertices[i].z);
//							faceMaxX = Math.max(faceMaxX, face.vertices[i].x);
//							faceMaxY = Math.max(faceMaxY, face.vertices[i].y);
//							faceMaxZ = Math.max(faceMaxZ, face.vertices[i].z);
//						}
//						faceLight = calculateBlockLighting(side, world, world.getBlock(x, y, z), x,y,z, colR,colG,colB, AxisAlignedBB.getBoundingBox(faceMinX,faceMinY,faceMinZ, faceMaxX,faceMaxY,faceMaxZ));
//					}
//
//					tes.setNormal(face.faceNormal.x, face.faceNormal.y, face.faceNormal.z);
//
//					float averageU = 0F;
//					float averageV = 0F;
//					if(face.textureCoordinates!=null && face.textureCoordinates.length>0)
//					{
//						for(int i=0; i<face.textureCoordinates.length; ++i)
//						{
//							averageU += face.textureCoordinates[i].u;
//							averageV += face.textureCoordinates[i].v;
//						}
//						averageU = averageU / face.textureCoordinates.length;
//						averageV = averageV / face.textureCoordinates.length;
//					}
//
//					TextureCoordinate[] oldUVs = new TextureCoordinate[face.textureCoordinates.length];
//					for(int v=0; v<face.vertices.length; ++v)
//					{
//						float offsetU, offsetV;
//						offsetU = baseOffsetU;
//						offsetV = baseOffsetV;
//						if (face.textureCoordinates[v].u > averageU)
//							offsetU = -offsetU;
//						if (face.textureCoordinates[v].v > averageV)
//							offsetV = -offsetV;
//
//						oldUVs[v] = face.textureCoordinates[v];
//						TextureCoordinate textureCoordinate = face.textureCoordinates[v];
//						face.textureCoordinates[v] = new TextureCoordinate(
//								minU + sizeU * (textureCoordinate.u+offsetU),
//								minV + sizeV * (textureCoordinate.v+offsetV)
//								);
//					}
//					addFaceToWorldRender(face, tes, faceLight, translationMatrix, rotationMatrix, invertFaces, colR, colG, colB);
//					for(int v=0; v<face.vertices.length; ++v)
//						face.textureCoordinates[v] = new TextureCoordinate(oldUVs[v].u,oldUVs[v].v);
//				}
//		}
//	}
//	public static void renderWavefrontModelWithModifications(WavefrontObject model, Tessellator tes, Matrix4 translationMatrix, Matrix4 rotationMatrix, boolean flipTextureU, String... renderedParts)
//	{
//		Vertex vertexCopy = new Vertex(0,0,0);
//		Vertex normalCopy = new Vertex(0,0,0);
//
//		for(GroupObject groupObject : model.groupObjects)
//		{
//			boolean render = false;
//			if(renderedParts==null || renderedParts.length<1)
//				render = true;
//			else
//				for(String s : renderedParts)
//					if(groupObject.name.equalsIgnoreCase(s))
//						render = true;
//			if(render)
//				for(Face face : groupObject.faces)
//				{
//					if(face.faceNormal == null)
//						face.faceNormal = face.calculateFaceNormal();
//
//					normalCopy.x = face.faceNormal.x;
//					normalCopy.y = face.faceNormal.y;
//					normalCopy.z = face.faceNormal.z;
//					rotationMatrix.apply(normalCopy);
//
//
//					tes.setNormal(face.faceNormal.x, face.faceNormal.y, face.faceNormal.z);
//					for(int i=0; i<face.vertices.length; ++i)
//					{
//						Vertex vertex = face.vertices[i];
//						vertexCopy.x = vertex.x;
//						vertexCopy.y = vertex.y;
//						vertexCopy.z = vertex.z;
//						rotationMatrix.apply(vertexCopy);
//						translationMatrix.apply(vertexCopy);
//
//						if((face.textureCoordinates != null) && (face.textureCoordinates.length > 0))
//						{
//							TextureCoordinate textureCoordinate = face.textureCoordinates[flipTextureU?(face.textureCoordinates.length-1)-i: i];
//							tes.addVertexWithUV(vertexCopy.x, vertexCopy.y, vertexCopy.z, textureCoordinate.u, textureCoordinate.v);
//						}
//						else
//							tes.addVertex(vertexCopy.x, vertexCopy.y, vertexCopy.z);
//					}
//				}
//		}
//	}
//
//	public static void renderWavefrontWithIconUVs(WavefrontObject model, IIcon icon, String... parts)
//	{
//		renderWavefrontWithIconUVs(model, GL11.GL_QUADS, icon, parts);
//		renderWavefrontWithIconUVs(model, GL11.GL_TRIANGLES, icon, parts);
//	}
//
//	public static void renderWavefrontWithIconUVs(WavefrontObject model, int glDrawingMode, IIcon icon, String... parts)
//	{
//		if(icon==null)
//			return;
//		List<String> renderParts = Arrays.asList(parts);
//		tes().startDrawing(glDrawingMode);
//		for(GroupObject go : model.groupObjects)
//			if(go.glDrawingMode==glDrawingMode)
//				if(renderParts.contains(go.name))
//					tessellateWavefrontGroupObjectWithIconUVs(go, icon);
//		tes().draw();
//	}
//	public static void tessellateWavefrontGroupObjectWithIconUVs(GroupObject object, IIcon icon)
//	{
//		if(icon==null)
//			return;
//
//		float minU = icon.getInterpolatedU(0);
//		float sizeU = icon.getInterpolatedU(16) - minU;
//		float minV = icon.getInterpolatedV(0);
//		float sizeV = icon.getInterpolatedV(16) - minV;
//		float baseOffsetU = (16f/icon.getIconWidth())*.0005F;
//		float baseOffsetV = (16f/icon.getIconHeight())*.0005F;
//		for(Face face : object.faces)
//		{
//			float averageU = 0F;
//			float averageV = 0F;
//			if(face.textureCoordinates!=null && face.textureCoordinates.length>0)
//			{
//				for(int i=0; i<face.textureCoordinates.length; ++i)
//				{
//					averageU += face.textureCoordinates[i].u;
//					averageV += face.textureCoordinates[i].v;
//				}
//				averageU = averageU / face.textureCoordinates.length;
//				averageV = averageV / face.textureCoordinates.length;
//			}
//
//			TextureCoordinate[] oldUVs = new TextureCoordinate[face.textureCoordinates.length];
//			for(int v=0; v<face.vertices.length; ++v)
//			{
//				float offsetU, offsetV;
//				offsetU = baseOffsetU;
//				offsetV = baseOffsetV;
//				if (face.textureCoordinates[v].u > averageU)
//					offsetU = -offsetU;
//				if (face.textureCoordinates[v].v > averageV)
//					offsetV = -offsetV;
//
//				oldUVs[v] = face.textureCoordinates[v];
//				TextureCoordinate textureCoordinate = face.textureCoordinates[v];
//				face.textureCoordinates[v] = new TextureCoordinate(
//						minU + sizeU * (textureCoordinate.u+offsetU),
//						minV + sizeV * (textureCoordinate.v+offsetV)
//						);
//			}
//			face.addFaceForRender(ClientUtils.tes(),0);
//			for(int v=0; v<face.vertices.length; ++v)
//				face.textureCoordinates[v] = new TextureCoordinate(oldUVs[v].u,oldUVs[v].v);
//		}
//	}
//
//	public static void addFaceToWorldRender(Face face, Tessellator tes, BlockLightingInfo light, Matrix4 translationMatrix, Matrix4 rotationMatrix, boolean invert, float colR, float colG, float colB)
//	{
//		Vertex vertexCopy = new Vertex(0,0,0);
//		for(int i=0; i<face.vertices.length; ++i)
//		{
//			int target = !invert?i:(face.vertices.length-1-i);
//			int corner = (int)(target/(float)face.vertices.length*4);
//			Vertex vertex = face.vertices[target];
//			vertexCopy.x = vertex.x;
//			vertexCopy.y = vertex.y;
//			vertexCopy.z = vertex.z;
//			rotationMatrix.apply(vertexCopy);
//			translationMatrix.apply(vertexCopy);
//			if(light!=null)
//			{
//				tes.setBrightness(corner==0?light.brightnessTopLeft: corner==1?light.brightnessBottomLeft: corner==2?light.brightnessBottomRight: light.brightnessTopRight);
//				float r = corner==0?light.colorRedTopLeft: corner==1?light.colorRedBottomLeft: corner==2?light.colorRedBottomRight: light.colorRedTopRight;
//				float g = corner==0?light.colorGreenTopLeft: corner==1?light.colorGreenBottomLeft: corner==2?light.colorGreenBottomRight: light.colorGreenTopRight;
//				float b = corner==0?light.colorBlueTopLeft: corner==1?light.colorBlueBottomLeft: corner==2?light.colorBlueBottomRight: light.colorBlueTopRight;
//				tes.setColorOpaque_F(r, g, b);
//			}
//			else
//			{
//				tes.setBrightness(0xb000b0);
//				tes.setColorOpaque_F(colR,colG,colB);
//			}
//
//			if(face.textureCoordinates!=null && face.textureCoordinates.length>0)
//			{
//				TextureCoordinate textureCoordinate = face.textureCoordinates[target];
//				tes.addVertexWithUV(vertexCopy.x, vertexCopy.y, vertexCopy.z, textureCoordinate.u, textureCoordinate.v);
//			}
//			else
//			{
//				tes.addVertex(vertexCopy.x, vertexCopy.y, vertexCopy.z);
//			}
//		}
//	}
//
//
//	public static void renderItemIn2D(IIcon icon, double[] uv, int width, int height, float depth)
//	{
//		double uMin = icon.getInterpolatedU(uv[0]*16);
//		double uMax = icon.getInterpolatedU(uv[1]*16);
//		double vMin = icon.getInterpolatedV(uv[2]*16);
//		double vMax = icon.getInterpolatedV(uv[3]*16);
//
//		double w = width/16d/2;
//		double h = height/16d;
//		tes().startDrawingQuads();
//		tes().setNormal(0.0F, 0.0F, 1.0F);
//		tes().addVertexWithUV(-w, 0, 0.0D, uMin, vMax);
//		tes().addVertexWithUV( w, 0, 0.0D, uMax, vMax);
//		tes().addVertexWithUV( w, h, 0.0D, uMax, vMin);
//		tes().addVertexWithUV(-w, h, 0.0D, uMin, vMin);
//		tes().draw();
//		tes().startDrawingQuads();
//		tes().setNormal(0.0F, 0.0F, -1.0F);
//		tes().addVertexWithUV(-w, h, (0.0F - depth), uMin, vMin);
//		tes().addVertexWithUV( w, h, (0.0F - depth), uMax, vMin);
//		tes().addVertexWithUV( w, 0, (0.0F - depth), uMax, vMax);
//		tes().addVertexWithUV(-w, 0, (0.0F - depth), uMin, vMax);
//		tes().draw();
//		double f5 = 0.5F * (uMin - uMax) / (float)width;
//		double f6 = 0.5F * (vMax - vMin) / (float)height;
//		int k;
//		double f7;
//		double f8;
//		double f9;
//
//		tes().startDrawingQuads();
//		tes().setNormal(0.0F, 1.0F, 0.0F);
//		for(k=0; k<width; k++)
//		{
//			f7 = k/(double)width;
//			f8 = uMin + (uMax - uMin) * f7 - f5;
//			f9 = k/(double)icon.getIconWidth();
//			tes().addVertexWithUV(-w+f9, 0, -depth, f8, vMax);
//			tes().addVertexWithUV(-w+f9, 0, 0, f8, vMax);
//			tes().addVertexWithUV(-w+f9, h, 0, f8, vMin);
//			tes().addVertexWithUV(-w+f9, h, -depth, f8, vMin);
//		}
//		tes().draw();
//
//		tes().startDrawingQuads();
//		tes().setNormal(1.0F, 0.0F, 0.0F);
//		for(k=0; k<width; k++)
//		{
//			f7 = k/(double)width;
//			f8 = uMin + (uMax - uMin) * f7 - f5;
//			f9 = (k+1)/(double)icon.getIconWidth();
//			tes().addVertexWithUV(-w+f9, h, -depth, f8, vMin);
//			tes().addVertexWithUV(-w+f9, h, 0, f8, vMin);
//			tes().addVertexWithUV(-w+f9, 0, 0, f8, vMax);
//			tes().addVertexWithUV(-w+f9, 0, -depth, f8, vMax);
//		}
//		tes().draw();
//
//		tes().startDrawingQuads();
//		tes().setNormal(0.0F, 1.0F, 0.0F);
//		for (k = 0; k < height; ++k)
//		{
//			f7 = k / (double)height;
//			f8 = vMax + (vMin - vMax) * f7 - f6;
//			f9 = (k+1)/(double)icon.getIconHeight();
//			tes().addVertexWithUV(-w, f9, 0, uMin, f8);
//			tes().addVertexWithUV( w, f9, 0, uMax, f8);
//			tes().addVertexWithUV( w, f9, -depth, uMax, f8);
//			tes().addVertexWithUV(-w, f9,- depth, uMin, f8);
//		}
//		tes().draw();
//
//		tes().startDrawingQuads();
//		tes().setNormal(0.0F, -1.0F, 0.0F);
//		for (k = 0; k < height; ++k)
//		{
//			f7 = k / (double)height;
//			f8 = vMax + (vMin - vMax) * f7 - f6;
//			f9 = k/(double)icon.getIconHeight();
//			tes().addVertexWithUV( w, f9, 0, uMax, f8);
//			tes().addVertexWithUV(-w, f9, 0, uMin, f8);
//			tes().addVertexWithUV(-w, f9, -depth, uMin, f8);
//			tes().addVertexWithUV( w, f9, -depth, uMax, f8);
//		}
//		tes().draw();
//	}
//
//	public static void drawInventoryBlock(Block block, int metadata, RenderBlocks renderer)
//	{
//		Tessellator tes = tes();
//		GL11.glPushMatrix();
//		GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
//		GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
//		tes.startDrawingQuads();
//		tes.setNormal(0.0F, -1.0F, 0.0F);
//		renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.overrideBlockTexture!=null?renderer.overrideBlockTexture: renderer.getBlockIconFromSideAndMetadata(block, 0, metadata));
//		tes.draw();
//		tes.startDrawingQuads();
//		tes.setNormal(0.0F, 1.0F, 0.0F);
//		renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.overrideBlockTexture!=null?renderer.overrideBlockTexture: renderer.getBlockIconFromSideAndMetadata(block, 1, metadata));
//		tes.draw();
//		tes.startDrawingQuads();
//		tes.setNormal(0.0F, 0.0F, -1.0F);
//		renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.overrideBlockTexture!=null?renderer.overrideBlockTexture: renderer.getBlockIconFromSideAndMetadata(block, 2, metadata));
//		tes.draw();
//		tes.startDrawingQuads();
//		tes.setNormal(0.0F, 0.0F, 1.0F);
//		renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.overrideBlockTexture!=null?renderer.overrideBlockTexture: renderer.getBlockIconFromSideAndMetadata(block, 3, metadata));
//		tes.draw();
//		tes.startDrawingQuads();
//		tes.setNormal(-1.0F, 0.0F, 0.0F);
//		renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.overrideBlockTexture!=null?renderer.overrideBlockTexture: renderer.getBlockIconFromSideAndMetadata(block, 4, metadata));
//		tes.draw();
//		tes.startDrawingQuads();
//		tes.setNormal(1.0F, 0.0F, 0.0F);
//		renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.overrideBlockTexture!=null?renderer.overrideBlockTexture: renderer.getBlockIconFromSideAndMetadata(block, 5, metadata));
//		tes.draw();
//		GL11.glPopMatrix();
//	}
//Cheers boni =P
public static void drawBlockDamageTexture(Tessellator tessellatorIn, VertexBuffer worldRendererIn, Entity entityIn, float partialTicks, World world, Collection<BlockPos> blocks) {
    double d0 = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * (double) partialTicks;
    double d1 = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * (double) partialTicks;
    double d2 = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * (double) partialTicks;
    TextureManager renderEngine = Minecraft.getMinecraft().renderEngine;
    // 0-10
    int progress = (int) (Minecraft.getMinecraft().playerController.curBlockDamageMP * 10f) - 1;
    if (progress < 0)
        return;
    renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    //preRenderDamagedBlocks BEGIN
    GlStateManager.tryBlendFuncSeparate(774, 768, 1, 0);
    GlStateManager.enableBlend();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 0.5F);
    GlStateManager.doPolygonOffset(-3.0F, -3.0F);
    GlStateManager.enablePolygonOffset();
    GlStateManager.alphaFunc(516, 0.1F);
    GlStateManager.enableAlpha();
    GlStateManager.pushMatrix();
    //preRenderDamagedBlocks END
    worldRendererIn.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
    worldRendererIn.setTranslation(-d0, -d1, -d2);
    //		worldRendererIn.markDirty();
    for (BlockPos blockpos : blocks) {
        double d3 = (double) blockpos.getX() - d0;
        double d4 = (double) blockpos.getY() - d1;
        double d5 = (double) blockpos.getZ() - d2;
        Block block = world.getBlockState(blockpos).getBlock();
        TileEntity te = world.getTileEntity(blockpos);
        boolean hasBreak = block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockSign || block instanceof BlockSkull;
        if (!hasBreak)
            hasBreak = te != null && te.canRenderBreaking();
        if (!hasBreak) {
            IBlockState iblockstate = world.getBlockState(blockpos);
            if (iblockstate.getMaterial() != Material.AIR) {
                TextureAtlasSprite textureatlassprite = destroyBlockIcons[progress];
                BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
                blockrendererdispatcher.renderBlockDamage(iblockstate, blockpos, textureatlassprite, world);
            }
        }
    }
    tessellatorIn.draw();
    worldRendererIn.setTranslation(0.0D, 0.0D, 0.0D);
    // postRenderDamagedBlocks BEGIN
    GlStateManager.disableAlpha();
    GlStateManager.doPolygonOffset(0.0F, 0.0F);
    GlStateManager.disablePolygonOffset();
    GlStateManager.enableAlpha();
    GlStateManager.depthMask(true);
    GlStateManager.popMatrix();
// postRenderDamagedBlocks END
}
Also used : IBlockState(net.minecraft.block.state.IBlockState) TextureAtlasSprite(net.minecraft.client.renderer.texture.TextureAtlasSprite) TileEntity(net.minecraft.tileentity.TileEntity) TextureManager(net.minecraft.client.renderer.texture.TextureManager) BlockPos(net.minecraft.util.math.BlockPos)

Example 5 with TextureManager

use of net.minecraft.client.renderer.texture.TextureManager in project RFToolsDimensions by McJty.

the class SkyRenderer method renderClouds.

@SideOnly(Side.CLIENT)
public static void renderClouds(GenericWorldProvider provider, DimensionInformation information, float partialTicks) {
    GlStateManager.disableCull();
    Minecraft mc = Minecraft.getMinecraft();
    TextureManager renderEngine = mc.getTextureManager();
    float f1 = (float) (mc.getRenderViewEntity().lastTickPosY + (mc.getRenderViewEntity().posY - mc.getRenderViewEntity().lastTickPosY) * partialTicks);
    Tessellator tessellator = Tessellator.getInstance();
    float f2 = 12.0F;
    float f3 = 4.0F;
    RenderGlobal renderGlobal = mc.renderGlobal;
    double d0 = (CloudRenderAccessHelper.getCloudTickCounter(renderGlobal) + partialTicks);
    double entityX = mc.getRenderViewEntity().prevPosX + (mc.getRenderViewEntity().posX - mc.getRenderViewEntity().prevPosX) * partialTicks;
    double entityZ = mc.getRenderViewEntity().prevPosZ + (mc.getRenderViewEntity().posZ - mc.getRenderViewEntity().prevPosZ) * partialTicks;
    double d1 = (entityX + d0 * 0.029999999329447746D) / f2;
    double d2 = entityZ / f2 + 0.33000001311302185D;
    float y = provider.getCloudHeight() - f1 + 0.33F;
    int i = MathTools.floor(d1 / 2048.0D);
    int j = MathTools.floor(d2 / 2048.0D);
    d1 -= (i * 2048);
    d2 -= (j * 2048);
    renderEngine.bindTexture(locationCloudsPng);
    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    Vec3d vec3 = provider.getWorld().getCloudColour(partialTicks);
    float red = (float) vec3.xCoord;
    float green = (float) vec3.yCoord;
    float blue = (float) vec3.zCoord;
    float f8;
    float f9;
    float f10;
    if (mc.gameSettings.anaglyph) {
        f8 = (red * 30.0F + green * 59.0F + blue * 11.0F) / 100.0F;
        f9 = (red * 30.0F + green * 70.0F) / 100.0F;
        f10 = (red * 30.0F + blue * 70.0F) / 100.0F;
        red = f8;
        green = f9;
        blue = f10;
    }
    f10 = 0.00390625F;
    f8 = MathTools.floor(d1) * f10;
    f9 = MathTools.floor(d2) * f10;
    float f11 = (float) (d1 - MathTools.floor(d1));
    float f12 = (float) (d2 - MathTools.floor(d2));
    byte b0 = 8;
    byte b1 = 4;
    float f13 = 9.765625E-4F;
    GlStateManager.scale(f2, 1.0F, f2);
    float cr = information.getSkyDescriptor().getCloudColorFactorR();
    float cg = information.getSkyDescriptor().getCloudColorFactorG();
    float cb = information.getSkyDescriptor().getCloudColorFactorB();
    boolean randomColors = information.isPatreonBitSet(Patreons.PATREON_KENNEY);
    VertexBuffer renderer = tessellator.getBuffer();
    for (int k = 0; k < 2; ++k) {
        if (k == 0) {
            GlStateManager.colorMask(false, false, false, false);
        } else if (mc.gameSettings.anaglyph) {
            if (EntityRenderer.anaglyphField == 0) {
                GlStateManager.colorMask(false, true, true, true);
            } else {
                GlStateManager.colorMask(true, false, false, true);
            }
        } else {
            GlStateManager.colorMask(true, true, true, true);
        }
        for (int l = -b1 + 1; l <= b1; ++l) {
            for (int i1 = -b1 + 1; i1 <= b1; ++i1) {
                renderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
                float u = (l * b0);
                float v = (i1 * b0);
                float x = u - f11;
                float z = v - f12;
                if (randomColors) {
                    //                        cr = (float) ((u % 10.0f) / 10.0f);
                    //                        cg = (float) (((u + v) % 10.0f) / 10.0f);
                    //                        cb = (float) ((v % 10.0f) / 10.0f);
                    cr = x % 1.0f;
                    cg = (x + z) % 1.0f;
                    cb = z % 1.0f;
                }
                if (y > -f3 - 1.0F) {
                    renderer.pos((x + 0.0F), (y + 0.0F), (z + b0)).tex(((u + 0.0F) * f10 + f8), ((v + b0) * f10 + f9)).color(red * 0.7F * cr, green * 0.7F * cg, blue * 0.7F * cb, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex();
                    renderer.pos((x + b0), (y + 0.0F), (z + b0)).tex(((u + b0) * f10 + f8), ((v + b0) * f10 + f9)).color(red * 0.7F * cr, green * 0.7F * cg, blue * 0.7F * cb, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex();
                    renderer.pos((x + b0), (y + 0.0F), (z + 0.0F)).tex(((u + b0) * f10 + f8), ((v + 0.0F) * f10 + f9)).color(red * 0.7F * cr, green * 0.7F * cg, blue * 0.7F * cb, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex();
                    renderer.pos((x + 0.0F), (y + 0.0F), (z + 0.0F)).tex(((u + 0.0F) * f10 + f8), ((v + 0.0F) * f10 + f9)).color(red * 0.7F * cr, green * 0.7F * cg, blue * 0.7F * cb, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex();
                }
                if (y <= f3 + 1.0F) {
                    renderer.pos((x + 0.0F), (y + f3 - f13), (z + b0)).tex(((u + 0.0F) * f10 + f8), ((v + b0) * f10 + f9)).color(red * cr, green * cg, blue * cb, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex();
                    renderer.pos((x + b0), (y + f3 - f13), (z + b0)).tex(((u + b0) * f10 + f8), ((v + b0) * f10 + f9)).color(red * cr, green * cg, blue * cb, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex();
                    renderer.pos((x + b0), (y + f3 - f13), (z + 0.0F)).tex(((u + b0) * f10 + f8), ((v + 0.0F) * f10 + f9)).color(red * cr, green * cg, blue * cb, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex();
                    renderer.pos((x + 0.0F), (y + f3 - f13), (z + 0.0F)).tex(((u + 0.0F) * f10 + f8), ((v + 0.0F) * f10 + f9)).color(red * cr, green * cg, blue * cb, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex();
                }
                int j1;
                if (l > -1) {
                    for (j1 = 0; j1 < b0; ++j1) {
                        renderer.pos((x + j1 + 0.0F), (y + 0.0F), (z + b0)).tex(((u + j1 + 0.5F) * f10 + f8), ((v + b0) * f10 + f9)).color(red * 0.9F * cr, green * 0.9F * cg, blue * 0.9F * cb, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex();
                        renderer.pos((x + j1 + 0.0F), (y + f3), (z + b0)).tex(((u + j1 + 0.5F) * f10 + f8), ((v + b0) * f10 + f9)).color(red * 0.9F * cr, green * 0.9F * cg, blue * 0.9F * cb, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex();
                        renderer.pos((x + j1 + 0.0F), (y + f3), (z + 0.0F)).tex(((u + j1 + 0.5F) * f10 + f8), ((v + 0.0F) * f10 + f9)).color(red * 0.9F * cr, green * 0.9F * cg, blue * 0.9F * cb, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex();
                        renderer.pos((x + j1 + 0.0F), (y + 0.0F), (z + 0.0F)).tex(((u + j1 + 0.5F) * f10 + f8), ((v + 0.0F) * f10 + f9)).color(red * 0.9F * cr, green * 0.9F * cg, blue * 0.9F * cb, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex();
                    }
                }
                if (l <= 1) {
                    for (j1 = 0; j1 < b0; ++j1) {
                        renderer.pos((x + j1 + 1.0F - f13), (y + 0.0F), (z + b0)).tex(((u + j1 + 0.5F) * f10 + f8), ((v + b0) * f10 + f9)).color(red * 0.9F * cr, green * 0.9F * cg, blue * 0.9F * cb, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex();
                        renderer.pos((x + j1 + 1.0F - f13), (y + f3), (z + b0)).tex(((u + j1 + 0.5F) * f10 + f8), ((v + b0) * f10 + f9)).color(red * 0.9F * cr, green * 0.9F * cg, blue * 0.9F * cb, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex();
                        renderer.pos((x + j1 + 1.0F - f13), (y + f3), (z + 0.0F)).tex(((u + j1 + 0.5F) * f10 + f8), ((v + 0.0F) * f10 + f9)).color(red * 0.9F * cr, green * 0.9F * cg, blue * 0.9F * cb, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex();
                        renderer.pos((x + j1 + 1.0F - f13), (y + 0.0F), (z + 0.0F)).tex(((u + j1 + 0.5F) * f10 + f8), ((v + 0.0F) * f10 + f9)).color(red * 0.9F * cr, green * 0.9F * cg, blue * 0.9F * cb, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex();
                    }
                }
                if (i1 > -1) {
                    for (j1 = 0; j1 < b0; ++j1) {
                        renderer.pos((x + 0.0F), (y + f3), (z + j1 + 0.0F)).tex(((u + 0.0F) * f10 + f8), ((v + j1 + 0.5F) * f10 + f9)).color(red * 0.8F * cr, green * 0.8F * cg, blue * 0.8F * cb, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex();
                        renderer.pos((x + b0), (y + f3), (z + j1 + 0.0F)).tex(((u + b0) * f10 + f8), ((v + j1 + 0.5F) * f10 + f9)).color(red * 0.8F * cr, green * 0.8F * cg, blue * 0.8F * cb, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex();
                        renderer.pos((x + b0), (y + 0.0F), (z + j1 + 0.0F)).tex(((u + b0) * f10 + f8), ((v + j1 + 0.5F) * f10 + f9)).color(red * 0.8F * cr, green * 0.8F * cg, blue * 0.8F * cb, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex();
                        renderer.pos((x + 0.0F), (y + 0.0F), (z + j1 + 0.0F)).tex(((u + 0.0F) * f10 + f8), ((v + j1 + 0.5F) * f10 + f9)).color(red * 0.8F * cr, green * 0.8F * cg, blue * 0.8F * cb, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex();
                    }
                }
                if (i1 <= 1) {
                    for (j1 = 0; j1 < b0; ++j1) {
                        renderer.pos((x + 0.0F), (y + f3), (z + j1 + 1.0F - f13)).tex(((u + 0.0F) * f10 + f8), ((v + j1 + 0.5F) * f10 + f9)).color(red * 0.8F * cr, green * 0.8F * cg, blue * 0.8F * cb, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex();
                        renderer.pos((x + b0), (y + f3), (z + j1 + 1.0F - f13)).tex(((u + b0) * f10 + f8), ((v + j1 + 0.5F) * f10 + f9)).color(red * 0.8F * cr, green * 0.8F * cg, blue * 0.8F * cb, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex();
                        renderer.pos((x + b0), (y + 0.0F), (z + j1 + 1.0F - f13)).tex(((u + b0) * f10 + f8), ((v + j1 + 0.5F) * f10 + f9)).color(red * 0.8F * cr, green * 0.8F * cg, blue * 0.8F * cb, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex();
                        renderer.pos((x + 0.0F), (y + 0.0F), (z + j1 + 1.0F - f13)).tex(((u + 0.0F) * f10 + f8), ((v + j1 + 0.5F) * f10 + f9)).color(red * 0.8F * cr, green * 0.8F * cg, blue * 0.8F * cb, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex();
                    }
                }
                tessellator.draw();
            }
        }
    }
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    GlStateManager.disableBlend();
    GlStateManager.enableCull();
}
Also used : TextureManager(net.minecraft.client.renderer.texture.TextureManager) Minecraft(net.minecraft.client.Minecraft) Vec3d(net.minecraft.util.math.Vec3d) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

TextureManager (net.minecraft.client.renderer.texture.TextureManager)19 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)4 ThreadDownloadImageData (net.minecraft.client.renderer.ThreadDownloadImageData)3 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)3 Minecraft (net.minecraft.client.Minecraft)2 Tessellator (net.minecraft.client.renderer.Tessellator)2 ITextureObject (net.minecraft.client.renderer.texture.ITextureObject)2 Item (net.minecraft.item.Item)2 ResourceLocation (net.minecraft.util.ResourceLocation)2 Vec3d (net.minecraft.util.math.Vec3d)2 Fluid (net.minecraftforge.fluids.Fluid)2 IWorldView (com.xcompwiz.lookingglass.api.view.IWorldView)1 Dimension (java.awt.Dimension)1 BufferedImage (java.awt.image.BufferedImage)1 File (java.io.File)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 ArrayList (java.util.ArrayList)1 ItemCameraMonitor (net.geforcemods.securitycraft.items.ItemCameraMonitor)1 CameraView (net.geforcemods.securitycraft.misc.CameraView)1