Jump to content

Recommended Posts

Posted

In a 1.7.10 mod I made a bomb that could be thrown and explodes on impact, and it worked.

However, I'm having trouble updating it to 1.8.

 

When I throw the item after trying to update the code it crashes.

(With this if it matters)

 

I can't find anything about rendering simple thrown projectiles in 1.8 or about updating it to 1.8, and there are still pretty much no YouTube tutorials at all for 1.8 except for simple blocks and items. So I'm kind of at a loss here.

 

Main class:

 

  Reveal hidden contents

 

 

Bomb item:

 

  Reveal hidden contents

 

 

ClientProxy:

 

  Reveal hidden contents

 

 

Item registry:

 

  Reveal hidden contents

 

 

Could someone please shed some light on why this isn't working?

 

Posted

Caused by: java.lang.NullPointerException

        at net.minecraft.client.renderer.entity.RenderSnowball.doRender(RenderSnowball.java:41) ~[RenderSnowball.class:?]

 

RenderSnowball code please, and please mark line 41 if you could.

Posted

 

  Reveal hidden contents

 

Posted

Firstly remove __OBFID, that's vanilla classes only (From what I've heard)

Secondly I suggest naming your variables to something other than srg names, rather than private final RenderItem field_177083_e; you can call it renderItem or something more understandable. Same with the methods.

 

Lastly either field_177083_e, field_177084_a, or entity is null on line 41. My best guess is that it is entity, add these 3 lines above line 41 to find out which one it is

 

System.out.println("RenderItem " + (field_177083_e == null));
System.out.println("Item " + (field_177084_a == null));
System.out.println("entity " + (entity == null));

Posted

Oh derp, So basically you're trying to get your entity to render as a snowball? I wouldn't know what the issue is if it is a vanilla class, unless this happens with vanilla snowballs as well.

Posted

No wonder if you are putting NULL to RenderItem:

Code:

public RenderSnowball(RenderManager p_i46137_1_, Item p_i46137_2_, RenderItem p_i46137_3_)

 

You:

new RenderSnowball(Minecraft.getMinecraft().getRenderManager(), ItemReg.bomb, null)

 

You need to Minecraft.getMinecraft().getRenderItem()

 

 

  Quote

1.7.10 is no longer supported by forge, you are on your own.

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.