Jump to content

[Solved][1.7.x] Clarification on some block rendering stuff


Recommended Posts

Posted

Okay, I'm making a cloud block that can be walked on but want to play around with transparency, opaqueness, etc to get a visual effect that I like.

 

I can find a lot of methods that I know are related to controlling this stuff, but it is not clear to me how they all inter-work.

 

Here's what I I think I know (please confirm or correct):

- getRenderBlock() should return 1 to allow alpha transparency (which I want).  Is the alpha just whatever I put in the texture, or is there another additional alpha control?  If I want to control the alpha separately from the texture, do I need to do a custom render?

- renderAsNormalBlock() should return true since I want a square normal block shape, right?

- isOpaqueCube() should return false since I want light to go through it, right?  This then enables lightOpacity to have effect?  Why does the comments also mention that it indicates full cube and that torches and such can be attached?

- lightOpacity should be something less than 255 because I want some light to go through it, but bit of blocking?

 

Here's where I need a bit of confirmation:

- getLightValue() comment mentions arguments as x, y, z, but in Block base class doesn't seem to pass those?  Here is Block class method:

    /**
     * Gets the light value of the specified block coords. Args: x, y, z
     */
    public int getLightValue()
    {
        return this.lightValue;
    }

I am possibly interested in a bit of light emanating from the block because these clouds are supposed to be sort of "heavenly".    So I want to play around with this a bit.  But how come BlockGlowStone doesn't do anything with this?  Where does the glow from glowstone come from?

- getUseNeighborBrightness() not sure if I need to do anything with this, I think not?

- isBlockNormalCube() seems to be combination of whether it blocks movement and renders normally.  If I did end up doing a custom render or some reason, would I want this to return false?  Why do they combine both movement and rendering in one check???

- isNormalCube() seems to add on to isBlockNormalCube() with check for power transmission.

- func_149730_j() seems to just return the opaque field value.  Not sure how that is used differently compared to isOpaqueCube() method.

- getMixedBrightnessForBlock().  What should I do with that method, if anything?

 

Anyway, if someone could sort of help me sort out what of the above is important to make a semi-transparent, possibly slightly light-emanating block.

 

I think my confusion stems from some of the names like "opaque" also seeming to have implications on "solid".  Maybe the naming is poor.  I'd prefer for the rendering functions and the functions for collisions and attaching all be more distinct.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

Also, how does this all work with Materials.  I notice they have an isSolid() and isOpaque() method.  There is also an setTranslucent() method?

 

I'm thinking the proper way to do it is create custom material and then make sure the custom material passes the material values. Like the block's isOpaque() should just call the material's isOpaque().  Is that the "proper" way to do it?

 

It seems that the setTranslucent() is important to let light go through?  Except it is a private field in Material class...which brings up question on whether a custom material should extend Material, or should I just call Material and use its methods to create new material.  I'm thinking the latter.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.