Jump to content

Recommended Posts

Posted

What i'm trying to do is have a potion effect that render cows as cave spider.

Event handler:

 

  Reveal hidden contents

 

RenderCowToSpider:

 

  Reveal hidden contents

 

Posted

I'll try to use packets to update that.

When the game knows if the cow have a potion effect (due to me logging in and out), the console is printing out this repetitive message:

 

  Reveal hidden contents

 

The 212 line of minh2908.potions.init.events.EventSubscriber is the r.doRender part of the code that i posted.

 

Posted

Tried the isRemote check, doesn't seems to fix it

The entire console after i terminate the game was this:

 

  Reveal hidden contents

 

I did see something like:

Exception caught during firing event net.minecraftforge.client.event.RenderLivingEvent$Pre@1400b97 (number changes everytime, I got this through a screenshot).

It has something to do with the dorender part, because it works if i just use event.setCanceled(true)

Posted

The reason is when you r.doRender() it invokes the RenderLivingEvent.Pre event, so recursion happens, where the method keeps calling itself, until the stack overflows. I don't know how you'd fix it but maybe you'd have to render it yourself.

 

If you look at RenderLivingBase, which your renderer extends, and look at its doRender(), you see the first line is

public void doRender(T entity, double x, double y, double z, float entityYaw, float partialTicks)
    {
        // This is how forge invokes the event.
        if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Pre<T>(entity, this, x, y, z))) return;
        .....
    }

Posted

Yeah, I thought that was the case when I saw the code in the console. Any idea on how to solve it?

 

Edit: I've solved this by adding and removing tags. Thanks for telling me the problem!

Edit2: When they move, it looks very glitchy . Why is that? (i'm not experience with rendering stuff)

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.