Jump to content

Recommended Posts

Posted

I installed the mod I'm working on in a client using forge build 9.10.1.865. The custom block I was working on is showing up as a map in the player's hands. It still renders perfectly in the world, and in a previous version of forge, it was working fine? Is this a bug or am I not doing something right?

 

For the most part, I followed minalien's tutorial @ http://minalien.com/tutorial-advancedmodelloader/ when I set up the block, so aside from having a TileEntity attached, you can assume that the overrides are the same.

Posted

Hi

 

That's pretty strange.  Did you derive the corresponding item from an ItemMap perhaps?  Does it look like a map in all item views(Inventory, First person, third person, or dropped on the ground (not placed as a block))?  Perhaps you haven't registered the item properly?

 

All I can suggest is that you insert a breakpoint in the minecraft code responsible for rendering a map

(MapItemRenderer.renderMap) and then track back up the stack to see why it is being called instead of your IItemRenderer.

 

-TGG

 

Posted

Thanks for respond TGG, good questions.

 

My block has absolutely nothing to do with any of the map classes. I'm not subclassing anything out of the ordinary, just BlockContainer, ModelBase, TileEntity and TileEntitySpecialRenderer. My item renderer implements IItemRenderer without extending anything at all and it's a really simple class.

 

I checked to see if it looks like a map in all views and it does not. It only looks like a map in first-person view when it's being held in your hands. The view where you would normally read a map. It looks fine in third person, on the ground, in the inventory, etc.

 

I saw this in the recent change log for forge:

ml
	Added a RenderType that allows Map-style rendering w/o inheriting from
	ItemMap.

Unfortunately, I just started working with forge a week ago and I don't know my way around the library (or even eclipse) enough to figure out with any speed if that is the cause of my current dilemma. I'll be trying your suggested method for a while. Let me know if you think of anything. Thanks again, I appreciate it.

Posted

I don't have quite the latest Forge installed, but I'm guessing the key will be somewhere in here:

 

ItemRenderer.renderItemInFirstPerson

 

at the line which looks something like

 

      Render render;

        RenderPlayer renderplayer;

 

        if (itemstack != null && itemstack.getItem() instanceof ItemMap)

        {

 

I suspect they might have changed it to check for either a RenderType or RenderHelper or similar IItemRenderer method

 

Posted

Ah, that is a good clue.

 

Perhaps you might try changing your handleRenderType to say

if (type == FIRST_PERSON_MAP) return false;

return true;

 

I just had to use the new FIRST_PERSON_HOLDING instead of FIRST_PERSON_MAP and it worked fine. Problem solved. Thanks for all the help!

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.