Jump to content

Recommended Posts

Posted

I'm trying to figure out how to add colored tint to a block (or better still, just one face of it) that exists in the world. I imagine I would have to somehow access the block's TintIndex, but I have no idea how to do that or if that's even possible.

<signature></signature>

Posted

It would be easier to draw a transparent quad manually.

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.

Posted

I'm trying to dynamically add tint to a block with an item - make it more red/green/blue/whatever while keeping the same texture. I assumed the TintIndex would be the way to do it.

<signature></signature>

Posted

By "block " do you mean "all stone everywhere" or "that one cube right there"?

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.

Posted

Because I am intimately familiar with the Twilight Forest...mind explaining?

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.

Posted

By "block " do you mean "all stone everywhere" or "that one cube right there"?

 

The latter; ideally when the item is used on the block, it should tint that specific face dependent on what dye item is loaded in it, with more uses of the item applying a heavier shade. As an example, if the method were simply shadeSide(r,g,b), then one use with a blue dye would add, say, five to the blue value.

<signature></signature>

Posted

"That one cube right there" cannot be achieved via TintIndex or any other

Block

method.

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.

Posted

Well dang, then how do I do what I'm trying to do?

 

Edit for details: if it helps, the item I have is a projectile "weapon" that shoots a custom projectile that extends Entity.Arrow, so I can get the block that it hits easily.

<signature></signature>

Posted

Basically - paintball.

 

Way I see it, you would need to make some universal TileEntity which would be able to mimic (render) block that is at its coords and use data saved in TE (colorization values) to manipulate colors of faces. Problem is - every damn block can have ANY-damn face (model). Even stupid dirt block can be made to be e.g stairs or some other sphere-like shit (by changing its .json file).

 

This leads me to belive that the only way to achieve SAFE for use block-painting is to make some kind of special "painting block". Eventually you could alter other blocks, but as said - any block can have any model so I don't think it will be easy to do this for any side of block (you could maybe paint all quads facing some direction, but then BAM - any block can also use OTHER model than .json, and then BAM - it can even be .obj).

What is alredy done (as mod) is painting mod that allows you to "paint" whole block of wood or wool to other color, but that one uses block replacement (metadata of both wool and wood are literally "colors".

 

If you were to colorize WHOLE block (no matter what format), that would be infinitely easier, just call GL to alter rendering. But that has to be done in places beyond reach of the mortals, meaning - ASM hook. (I don't think there is a way to manipulate other ppls/vanilla models without having to write code for every possible block).

 

Therefore I conclude - Without some hi-tech coding, rendering redesign, probably ASM and other shit - there is no way to do this NICELY (universal).

 

Well... that's VERY pessimistic. I guess I had a bad day :o

1.7.10 is no longer supported by forge, you are on your own.

Posted

Hmmm.... I assume that you're referring to OpenBlocks when you mention the "other mod?" I tied to take a look at their code for the canvas, but I was really confused by it... I don't know where to look for information on rendering things. I think I might have bitten off more than I can chew for a "first mod" idea. It seemed so simple on paper...

 

Edit: spelling

 

Double edit: Thinking about OpenBlocks, would it be possible for me to do a similar thing with my item where I take the block that I hit with my projectile and replace it with a custom one that I can tint at will? If so, how do I grab the texture?

<signature></signature>

Posted

If you were to colorize WHOLE block (no matter what format), that would be infinitely easier, just call GL to alter rendering. But that has to be done in places beyond reach of the mortals, meaning - ASM hook. (I don't think there is a way to manipulate other ppls/vanilla models without having to write code for every possible block).

 

Therefore I conclude - Without some hi-tech coding, rendering redesign, probably ASM and other shit - there is no way to do this NICELY (universal).

 

Well... that's VERY pessimistic. I guess I had a bad day :o

I totally agree with that. Even if i managed to do this in 1.7.10 (with a lot of ASM), i don't want to look at 1.8.9 yet, as all rendering changed and i'll have to write all this from scratch.

And it's sometimes not even working.

 

@paradoxbomb

In short, it depends on which blocks you want to target. More you are targetting, harder it will be.

Simpliest solution here is, as said above, using tile entity and your own block to mimic another block, and recolor it. Just save old block state and color in your te, and use TESR to render a block with tint. Hint: you can recolor block, by using

GL11.glColor

before rendering it. Also, remember to push and pop matrixes!

Hardest solution is one that supports blocks with tile entities and... it's very hard. It requires a lot of ASM. So, my advice, don't even try it, if you have never worked with ASM before.

Posted

When you gaze into the abyss that is ASM, the abyss gazes back.

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.

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.