Jump to content

Using registered IIcon's with the tessellator...


Busti

Recommended Posts

Hi,

I registered a texture like this from an Item.

    @SideOnly(Side.CLIENT)
    def registerIcons(reg:IIconRegister) {
        sprites(0) = reg.registerIcon(TechnicaCore.RESOURCEID + "parts/Glass_Basic")
    }

 

...how can I use it in a rendering method with the Tesselator in the world renderer?

I tried using its U and V values for the vertex adding but it doesn't seem to work:

val minU = sprites(0).getMinU
        val maxU = sprites(0).getMaxU
        val minV = sprites(0).getMinV
        val maxV = sprites(0).getMaxV

        //Minecraft.getMinecraft.renderEngine.bindTexture(TextureMap.locationItemsTexture)

        
        val tesselator = Tessellator.instance
        tesselator.addVertexWithUV(pos.x+1, pos.y, pos.z, maxU, minV)
        tesselator.addVertexWithUV(pos.x+1, pos.y+1, pos.z, maxU, maxV)
        tesselator.addVertexWithUV(pos.x, pos.y+1, pos.z, minU, maxV)
        tesselator.addVertexWithUV(pos.x, pos.y, pos.z, minU, minV)

 

I also tried using the Item Texture but it doesn't work either.

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

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.

Guest
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.

Announcements



×
×
  • Create New...

Important Information

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