Jump to content

[1.7.10]Getting vanilla textures off TextureMap


Recommended Posts

So, i tried to have a 14*14 face, but it uses the full texture, not the center 14*14 pixels as intendet. P.S.: wp is 1d/16d


public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float f) {
	IIcon woodOak = Blocks.planks.getIcon(0, 0);
	IIcon woodEbony = GameRegistry.findBlock("derpyshiz", "plank").getIcon(0, 0);

	double bodyMinU = ((woodEbony.getMaxU()-woodEbony.getMaxU())*wp)+woodEbony.getMinU();
	double bodyMaxU = woodEbony.getMaxU()-((woodEbony.getMaxU()-woodEbony.getMaxU())*wp);
	double bodyMinV = ((woodEbony.getMaxV()-woodEbony.getMaxV())*wp)+woodEbony.getMinV();
	double bodyMaxV = woodEbony.getMaxV()-((woodEbony.getMaxV()-woodEbony.getMaxV())*wp);

	Tessellator tessellator = Tessellator.instance;
	GL11.glTranslated(x, y, z);
	//front body
	tessellator.addVertexWithUV(1-wp, wp, wp, bodyMinU, bodyMaxV);
	tessellator.addVertexWithUV(wp, wp, wp, bodyMaxU, bodyMaxV);
	tessellator.addVertexWithUV(wp, 1-wp, wp, bodyMaxU, bodyMinV);
	tessellator.addVertexWithUV(1-wp, 1-wp, wp, bodyMinU, bodyMinV);


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.