Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Help With Custom Block Models?


SteakHead
 Share

Recommended Posts

Hi, I'm having some problems creating a block with custom block model (similar to how a beacon is created) with RenderBlocks.class. I orgininally posted on minecraftfourms.net so if you wouldn't mind, follow this link. (mainly because im too lazy to type it out here). Thx!

http://www.minecraftforum.net/topic/2614094-forge-help-with-custom-block-renderer/

 

EDIT:

I found the problem. I was calling the wrong constructor of RenderBlocks. I needed to give an instance of IBlockAccess, because it was calling that. That is what was returning the null pointer exception. derp. xD

Link to comment
Share on other sites

I think it's better to use the tessellator directly instead of the Model thingy, since each time you call render() on each part (cube) of your model, it does this:

- check if it's not hidden then
  - check if it's visible then
    - check if it's not compiled then
      - compile display list
    . else
      - translate the offset
      - check if it's rotate angles X, Y and Z are equal to 0.0F then
        - check if it's rotation points X, Y and Z are equal to 0.0F then
          - use displayList
          - check if it has child parts then
            - render childs
          . end if
        . else
          - translate to rotation points * par1
          - use displayList
          - check if it has child parts then
            - render childs
          . end if
          - counter-translate to rotation points * par1
        . end if

etc...

 

To look at what exactly it does, look up the render() method in the ModelRenderer class

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

I think it's better to use the tessellator directly instead of the Model thingy, since each time you call render() on each part (cube) of your model, it does this:

- check if it's not hidden then
  - check if it's visible then
    - check if it's not compiled then
      - compile display list
    . else
      - translate the offset
      - check if it's rotate angles X, Y and Z are equal to 0.0F then
        - check if it's rotation points X, Y and Z are equal to 0.0F then
          - use displayList
          - check if it has child parts then
            - render childs
          . end if
        . else
          - translate to rotation points * par1
          - use displayList
          - check if it has child parts then
            - render childs
          . end if
          - counter-translate to rotation points * par1
        . end if

etc...

 

To look at what exactly it does, look up the render() method in the ModelRenderer class

 

My fault for not elaborating. I'm not actually using a conventional model. I want to render a block using RenderBlocks, like a beacon. I'm soon this so I don't actually have to use a model file.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.