Jump to content

Recommended Posts

Posted

So, I am working on a mod and I can say I have some decent experience with java, but while experimenting with my custom renderer, I ran into a problem.

 

Everything works perfectly, it renders exactly a it's supposed to do, but there's a little... thing, that I think could be a bug.

 

I'm not sure if it's a bug in Minecraft, Forge or even Java itself. It may be any of these.

 

Now, straight to what the problem is:

I have declared the entity (registered it) and the renderer. Then I wanted to make a variation of that entity, rendered with the same renderer as they have to do basically the same thing.

 

First, let me show you how my entities "parented".

Entity>EntityThrowable>EntityBomb - this is a bomb. The renderer for this works well.

Entity>EntityThrowable>EntityBomb>EntityStckyBomb - this bomb is sticky. The renderer works but uses the EntityBomb texture.

 

Now, the sticky bomb extends the normal bomb and just stops when something is touched. It has a custom Icon (the item has one), but it is drawn wth the default icon.

 

It also draws like a normal bomb (keeps bouncing around after it has sticked), but it explodes where it's supposed to be stuck. //note that this may be a problem on my part.

 

The problem is that when it renders, it uses the default ItemBomb texture instead of its own.

 

Now, this may seem like a problem with my mod, but here comes the thing that made me think it's not my fault.

 

I tried to "clone" EntityBomb, and the bomb item launches the clone (which is just a bunch of inherited events). The result was the same. I tried setting the renderer for the new bomb clone and for the sticky bomb, ignoring the main bomb entity, but that leads to the default rendering (a white block).

 

Then I tried implementing a method that returns a ResourceLocation with the custom texture, but it doesn't seem to be called.

 

Looks like the renderer can't render entities that aren't direct childs of vanilla entities (like EntityThrower).

 

Then, while I was writing this post, I thought it might have been a missing override, but it wasn't. Then I tried editing the renderer to recognize if it's rendering a bomb or a stickybomb, but I can't find a way to do it.

 

My code is pretty messy (tons of unused varables and methods) because this is not a serious project and I'm experimenting, but I'm pretty sure it's not a problem on my side.

 

I hope this can help, I'm going to make EntityStickyBomb an entity on it's own instead of extending the normal bomb. That will surely fix my problem, even if it means having two renders that do the same thing.

 

Bye!

-GV

 

ps: sorry if some letters are missing, my keyboard is acting crazy today.

 

EDIT: quick thing: I'm on the recomended forge for 1.7.10, and I'm now updating to 1.8.1. (EDIT2: actually, to 1.8 ).

Posted

No, they can just fine, you're registering your entity incorrectly and only creating the base EntityBomb on the client. Check your network/spawn code.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

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.