Jump to content

Recommended Posts

Posted

I have made a block using techne that I would like to have modeled in my inventory/hand as well as the world. For some reason, I cant get it to work. It just displays as an Item with a missing texture.

 

  Reveal hidden contents

 

 

Here is all the code that is related to the block. Note: The block is a machine as well so there is a lot of code unrelated to the render. The block is named enditeReactor.

 

BlockEnditeReactor

 

  Reveal hidden contents

 

 

RenderEnditeReactor

 

 

  Reveal hidden contents

 

 

RenderItemEnditeReactor

 

 

  Reveal hidden contents

 

 

TileEntityEnditeReactor

 

 

  Reveal hidden contents

 

 

ClientProxy

 

 

  Reveal hidden contents

 

 

ModelBlockEnditeReactor

 

  Reveal hidden contents

 

 

If any other classes are necessary, I can paste them here.

Thanks

 

 

Posted

Hi

 

If you put a breakpoint in your shouldUseRenderHelper INVENTORY case, (or alternatively System.out.println("renderItem()");), does it get called or not?

 

If not, you probably haven't registered the IItemRenderer correctly.  Is RunicScrolls.blockEnditeReactor null perhaps?

 

-TGG

 

Posted

Thanks for the response.

 

I looked and the shouldUseRenderHelper method isnt being called at all. In my main class, RunicScrolls.java, I have blockEnditeReactor registered like so:

 blockEnditeReactor = new BlockEnditeReactor(false).setBlockName("blockEnditeReactor").setCreativeTab(scrollTab).setHardness(5.0F).setResistance(6000000.0F); 

 

This is how I have registered my other blocks, excluding the false. This is only because the block has an active state and an unactive state. This is a Boolean in the constructor, so false is necessary. How would I register the IItemRenderer? I dont think im not sure if I have done this and that could be the issue.

Posted

Hi

 

I think the Block is being registered ok, but your IItemRenderer is not, perhaps.

 

you are registering it here in ClientProxy

		MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(RunicScrolls.blockEnditeReactor), new RenderItemEnditeReactor(render, new TileEntityEnditeReactor()));

Off the top of my head that looks right so I suspect that either

1) this proxy method is never called, or

2) this proxy method is called before your blockEnditeReactor = new BlockEnditeReactor is being called.

 

-TGG

Posted

The client proxy is definately being called at some point otherwise the block wouldn't have a model. I just removed the line

 ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEnditeReactor.class, render); 

from the registerRenderThings() method and the block didn't render.

 

I then added some print lines to the registerRenderThings() method in the client proxy and the preInit method in my main. As shown by the console, the proxy is being called first.

[13:34:05] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
[13:34:05] [Client thread/INFO] [FML]: Found 341 ObjectHolder annotations
[13:34:05] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
ClientProxy
preInit
[13:34:05] [Client thread/INFO] [FML]: Applying holder lookups
[13:34:05] [Client thread/INFO] [FML]: Holder lookups applied

 

I moved the initialization to the init method in my main.

 

IT WORKED!!!

 

Thank you so much! I can finally release version 2.2 of my mod. Thanks! :) :) :) :) :) :) :)

 

nRj2lj1.png

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.