Jump to content

Recommended Posts

Posted (edited)

I am building a utility that will allow me to generate the code for my configs more easily, but I need to figure out how the Note Particle's color is generated as the particle will be a possible option in my configs. The code I have found in the NoteParticle.class (featured below) will only generate gray particles, even though there are numerous colors you can get. When doing the particle command only 1 value controls the color ranging from 0.0(green) up to 1.0(also green). Because of this I know a simple rgb to hex and hex to rgb coverter in my utility will not be enough without some other step that I cannot figure out. Anyone have any ideas on where to look or what is going on?

private NoteParticle(World p_i51018_1_, double p_i51018_2_, double p_i51018_4_, double p_i51018_6_, double p_i51018_8_) {
  super(p_i51018_1_, p_i51018_2_, p_i51018_4_, p_i51018_6_, 0.0D, 0.0D, 0.0D);
  this.particleRed = Math.max(0.0F, MathHelper.sin(((float)p_i51018_8_ + 0.0F) * ((float)Math.PI * 2F)) * 0.65F + 0.35F);
  this.particleGreen = Math.max(0.0F, MathHelper.sin(((float)p_i51018_8_ + 0.33333334F) * ((float)Math.PI * 2F)) * 0.65F + 0.35F);
  this.particleBlue = Math.max(0.0F, MathHelper.sin(((float)p_i51018_8_ + 0.6666667F) * ((float)Math.PI * 2F)) * 0.65F + 0.35F);
}

(Not the full constructor, but the relevant code for what I have found)

Edited by saxon564

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.