Jump to content

Recommended Posts

Posted

I'm trying to create a custom particle effect that renders above a block. Right now I don't get any errors, but it doesn't render. I'm hoping someone has some insight as to what I'm doing wrong.

 

What I did: I extended Particle, for now I'm literally just trying to get *something* to render above the block, so I didn't touch renderParticle or any else, just set a TextureAtlasSprite and overrided (overrode?) getFXLayer. I'll worry about getting the particle to behave the way I want when I can see it. :)

 

My code is below:

 

Particle Class

 

  Reveal hidden contents

 

 

In ClientProxy

 

  Reveal hidden contents

 

 

Function call in block class

 

  Reveal hidden contents

 

 

edit: added code tags for clarity

Posted
  On 10/11/2016 at 4:15 PM, Zetal said:

Try using

Minecraft.getMinecraft().renderGlobal.spawnParticle()

instead of

Minecraft.getMinecraft().effectRenderer.addEffect()

 

RenderGlobal#spawnParticle doesn't take a Particle as a parameter, it either takes a int for the particle id which corresponds to vanilla EnumParticleTypes or it takes an EnumParticleTypes. I have something called a particleId, but only so I can use the same method when I add a new particle to my mod, it doesn't correspond to a vanilla Particle it corresponds my mod's custom particles, of which there is currently only one. 

 

Unless I am missing something, using your suggested adjustment with my current code would just cause vanilla explosion particles (I believe those are the 0th vanilla particle type) to render above my block.

 

Am I missing something?

Posted

SuParticle.java -> public SuParticle()...

 

super(world, zSpeed, zSpeed, zSpeed, zSpeed, zSpeed, zSpeed);

I think this is the mistake youre looking for... The particle is getting spawned but not at the correct coordinates.

 

Try this instead:

super(xCoord, yCoord, zCoord, xSpeed, ySpeed, zSpeed);

Posted
  On 10/12/2016 at 9:24 AM, Thefjong said:

SuParticle.java -> public SuParticle()...

 

super(world, zSpeed, zSpeed, zSpeed, zSpeed, zSpeed, zSpeed);

 

Thank you!! I can't believe I missed that.  I don't even really get how that happened.  I feel very thick now, but thank you much.  Some times I guess it just takes a second set of eyes.

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.