Jump to content

Recommended Posts

Posted

I am creating a model in code by generating BakedQuads, using this constructor

public BakedQuad(int[] vertexDataIn, int tintIndexIn, EnumFacing faceIn, TextureAtlasSprite spriteIn, boolean applyDiffuseLighting, net.minecraft.client.renderer.vertex.VertexFormat format)

 

what are tintIndexIn, and spriteIn used for?

Current Project: Armerger 

Planned mods: Light Drafter  | Ore Swords

Looking for help getting a mod off the ground? Coding  | Textures

Posted

The tint index is passed to

IBlockColor

/

IItemColor

so they know which part of the model is being coloured and can return the appropriate colour based on that.

 

I believe the

TextureAtlasSprite

is a location on the block texture sheet to render on the quad (i.e. the quad's texture).

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

I am trying to choose the rgba color for the quad to be during runtime.

I followed the calls in RenderItem to method in TextureUtil:

public static int anaglyphColor(int p_177054_0_)
    {
        int i = p_177054_0_ >> 24 & 255;
        int j = p_177054_0_ >> 16 & 255;
        int k = p_177054_0_ >> 8 & 255;
        int l = p_177054_0_ & 255;
        int i1 = (j * 30 + k * 59 + l * 11) / 100;
        int j1 = (j * 30 + k * 70) / 100;
        int k1 = (j * 30 + l * 70) / 100;
        return i << 24 | i1 << 16 | j1 << 8 | k1;
    }

Which seems to be getting the rgba information correctly and then completely destroying the information ...

 

If my item doesn't have a texture will the tintIndexIn do anything?

Current Project: Armerger 

Planned mods: Light Drafter  | Ore Swords

Looking for help getting a mod off the ground? Coding  | Textures

Posted

RenderItem#renderQuads

uses the quad's tint index to get the colour from

ItemColors

(i.e. the

IItemColor

registered for the

Item

). If anaglyph mode is enabled,

TextureUtil.anaglyphColor

is used to translate the colour into an anaglyph colour.

 

I don't know enough about the rendering system to say what happens when a colour is applied to a quad without a texture.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

I am confused beyond expression ... I build my mod and made a lan world and had another player connect, this is what my item looks like (yes it includes those chickens in the background) as she moves around it changes. sometimes its chickens sometimes there are bows, once there was even a giant bat.

imgur

(The guy in red is holding a MeleeCore item that is generated with the name Bluex5 which gets registered during world load event in LiDrEvents.class)

 

Nothing shows up on my client when I am holding the item. (btw I am expecting a small series of 5 blue cubes extended in a single direction)

 

Here is my current project

If you want to know where a specific thing is let me know.

Current Project: Armerger 

Planned mods: Light Drafter  | Ore Swords

Looking for help getting a mod off the ground? Coding  | Textures

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.