• Hello Guest! Did you know that ProjectKorra has an official Discord server? A lot of discussion about the official server, development process, and community discussion happens over there. Feel free to join now by clicking the link below.

    Join the Discord Server

Omni's Particle Method Tutorial!

OmniCypher

Staff member
Lead Developer
Administrator
Plugin Developer
Hey guys! Just thought I'd give all the addon developers a heads up and quick tutorial on the new particle methods I've added to PK! Let me first show how I'll break down each method, optional variables (overloaded method variables for you smarty pants people) will be in italics and required parameters will be in bold. In each example I will be purposely using the most overloaded methods.

playLightningbendingParticle(Location loc, float xOffset, float yOffset, float zOffset)
This method is the lightning equivalent of playAirbendingParticle(). Pretty straightforward, this method will display lightning particles at the passed in Location with the optional X, Y, and Z offsets!

Example: playLightningbendingParticle(location, 0, 0, 0);



displayColoredParticle(Location loc, ParticleEffect type, String hexVal, float xOffset, float yOffset, float zOffset)
This method allows you to enter in a specific hexadecimal value and display a colored particle of the applicable types at the passed in Location with the optional X, Y, and Z offsets! Currently the applicable types are RED_DUST, MOB_SPELL and MOB_SPELL_AMBIENT which must be passed in the following format: ParticleEffect.<Name>. If nothing is passed in they will default to RED_DUST. The String argument is must meet one of the two following formats: "#RRGGBB" or "RRGGBB" (# is not required). As a side note a small list of certain colors will not be exactly the same as their corresponding hexadecimal values when using RED_DUSTparticles, for instance most shades of yellow will appear slightly green. I'm working on a implementing a slight conditional shift but it will take time to solve every case.

Example: displayColoredParticle(location, ParticleEffect.RED_DUST,"#00CC00",0,0,0)



Example: displayColoredParticle(location, ParticleEffect.MOB_SPELL,"#CC0066",0,0,0)



displayParticleVector(Location loc, ParticleEffect type, float xTrans, float yTrans, float zTrans)
This method allows you to "graph" specific vectors using particles! Applicable particle effects currently include FIREWORK_SPARK, SMOKE, LARGE_SMOKE, ENCHANT_TABLE, PORTAL, FLAME, CLOUD, and SNOW_SHOVEL which must be passed in the following format: ParticleEffect.<Name>. The xTrans, yTrans, and zTrans are all relative meaning 1 1 1 will make the particle travel positive 1 in each axis.

Example: displayParticleVector()location, ParticleEffect.FLAME, 1 1 1)



Thanks for reading! If you have any further questions feel free to ask!
 
Last edited:

Simplicitee

Staff member
Plugin Developer
Verified Member
Will you be adding the capability to use colored particles as the particle effect in the last method?
 

OmniCypher

Staff member
Lead Developer
Administrator
Plugin Developer
Will you be adding the capability to use colored particles as the particle effect in the last method?
Not possible, The particle types which can be colored can not be used to display a vector. All possible types (currently) are listed in this post...
 

OmniCypher

Staff member
Lead Developer
Administrator
Plugin Developer
Why isn't it possible? :p
Because of an alteration to the particles packet data behave in an entirely different manor when applied to different particle types, RED_DUST becomes colored, FLAME gains a vector. Its just odd behavior of Minecraft I'm taking advantage of in code form, I can only use the systems which are already in place.
 

Simplicitee

Staff member
Plugin Developer
Verified Member
Because of an alteration to the particles packet data behave in an entirely different manor when applied to different particle types, RED_DUST becomes colored, FLAME gains a vector. Its just odd behavior of Minecraft I'm taking advantage of in code form, I can only use the systems which are already in place.
Most of that is cool. Disappointing that colored particles can't be put in a vector like that.
 
Top