Jump to content

Coloring blocks.


tuskiomi

Recommended Posts

hello forge modders!

:-X

I have dug all around in the forge leaf class to find how to color block sprites like minecraft does to leaves.

in the leaves class i have dug up

this:

    public Icon getBlockTextureFromSideAndMetadata(int par1, int par2)
    {
        return (par2 & 3) == 1 ? this.iconArray[this.field_94394_cP][1] : ((par2 & 3) == 3 ? this.iconArray[this.field_94394_cP][3] : this.iconArray[this.field_94394_cP][0]);
    }

I honestly have no clue what ANY of this does (I mean what the heck is field_94394_cP?). could someone please assist me and tell me what this means?

 

edit:

iconarray and field_94394_cP are formatted like so:

private int field_94394_cP;

private Icon[][] iconArray = new Icon[2][];

Also, I should have you know that you are reading my signature.

Link to comment
Share on other sites

hello forge modders!

:-X

I have dug all around in the forge leaf class to find how to color block sprites like minecraft does to leaves.

in the leaves class i have dug up

this:

    public Icon getBlockTextureFromSideAndMetadata(int par1, int par2)
    {
        return (par2 & 3) == 1 ? this.iconArray[this.field_94394_cP][1] : ((par2 & 3) == 3 ? this.iconArray[this.field_94394_cP][3] : this.iconArray[this.field_94394_cP][0]);
    }

I honestly hav no clue what ANY of this does (I mean what the heck is field_94394_cP?). could someone please assist me and tell me what this means?

 

field_94394_cP is just a not-deobfuscated class variable.

 

In this case it is an array index.  If you're looking at leaves, I believe that field holds a reference to whether or not Minecraft is in fancy rendering (transparent leaves) or fast rendering (opaque leaves).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

okay, cna you point me to where i can learn to color blocks properly?

 

	public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
    {
        return 16777215;  //change this
    }

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Oh do i see what i think?

so if i am correct;

i pick a hex color code and translate it to B10.

the par1, par2 and, par3  are coords.

can i apply this to ANY block?

 

Yes, its the decimal representation of a hexadecimal RRGGBB value.

par1/2/3 are the x/y/z coords of the specific block

And yes, you can use this function on any block you create (or base class edit existing blocks).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.



×
×
  • Create New...

Important Information

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