Jump to content

[1.12] How to replace texture in game?


WildHeart

Recommended Posts

Hello, do the thing which you can change in the game(creates a new stack and change certain data). I want to do to you during the game to replace the path to textures/models without rejoining the game. Earlier in 1.7 this can be done using the IItemRenderer, but now I don't see a solution.

 

Code 1.7 - icon:

@SideOnly(Side.CLIENT)
public final class IconRenderer implements IItemRenderer
{
    public static final IconRenderer INSTANCE = new IconRenderer();

    @Override
    public boolean handleRenderType(final ItemStack item, final ItemRenderType type)
    {
        return type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON;
    }

    @Override
    public boolean shouldUseRenderHelper(final ItemRenderType type, final ItemStack item, final ItemRendererHelper helper)
    {
        return false;
    }

    @Override
    public void renderItem(final ItemRenderType type, final ItemStack stack, final Object... data)
    {
        GL11.glPushMatrix();
        final Tessellator tess = Tessellator.instance;
        final EntityLivingBase entityliving = (EntityLivingBase) data[1];
        final IIcon icon = entityliving.getItemIcon(stack, 0);
        final float tickness = 0.0625F;

        ItemRenderer.renderItemIn2D(tess, icon.getMaxU(), icon.getMinV(), icon.getMinU(), icon.getMaxV(), icon.getIconWidth(), icon.getIconHeight(), tickness);
        GL11.glPopMatrix();
    }
}

How is this done?

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.