Jump to content

[solved]null pointer exception when rendering custom block in inventory.


Recommended Posts

Posted

As the title says I am having trouble rendering my custom block in the inventory, I got it to work with my chest, but with this block it doesn't work.  What I am trying to do is render the block model in the inventory with its texture, just like a custom chest would.

 

error log

 

  Reveal hidden contents

 

 

clientproxy class

 

  Reveal hidden contents

 

 

ItemRenderer

 

  Reveal hidden contents

 

 

Tile entity handler

 

  Reveal hidden contents

 

 

tileentitycomputerentity

 

  Reveal hidden contents

 

 

renderer class

 

  Reveal hidden contents

 

if (You.likescoding == false){
      You.goaway;
}

Posted

@Override
    public boolean handleRenderType(ItemStack item, ItemRenderType type) {
        // TODO Auto-generated method stub
        return true;
    }

    @Override
    public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
        // TODO Auto-generated method stub
        return true;
    }

Try return false ?

 

Did you ClientRegistry.bindTileEntitySpecialRenderer(args); ?

Posted

Got it working except the rotation isn't working correctly,

 

new render code

 

  Reveal hidden contents

 

 

this is what happens when I place it down.

 

  Reveal hidden contents

 

if (You.likescoding == false){
      You.goaway;
}

Posted

Never mind I fixed it, turns out I messed up something in the actual block code so This problem is solved

 

the problem with the rotation was in the tileentitycomputer class

 

  Reveal hidden contents

 

if (You.likescoding == false){
      You.goaway;
}

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.