Class ParticleShapeDefinition

java.lang.Object
com.ninjaguild.dragoneggdrop.utils.math.ParticleShapeDefinition

public class ParticleShapeDefinition
extends Object
Represents a defined particle shape. Allows for easy shape-creation with two expressions along the x and z axis, as well as an initial location to start the shape.
Author:
Parker Hawke - Choco
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  ParticleShapeDefinition.Prefab
    Pre-fabricated particle shape definitions.
  • Constructor Summary

    Constructors 
    Constructor Description
    ParticleShapeDefinition​(org.bukkit.Location initialLocation, String xExpression, String zExpression)
    Construct a new ParticleShapeDefinition with a given location, and mathmatical equations for both the x and z axis.
  • Method Summary

    Modifier and Type Method Description
    void executeExpression​(org.bukkit.Particle particleType, int particleAmount, double xOffset, double yOffset, double zOffset, double particleExtra)
    Execute the particle shape definition expressions with current values.
    void updateVariables​(double x, double z, double t, double theta)
    Update the variables with new values.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ParticleShapeDefinition

      public ParticleShapeDefinition​(org.bukkit.Location initialLocation, String xExpression, String zExpression)
      Construct a new ParticleShapeDefinition with a given location, and mathmatical equations for both the x and z axis.
      Parameters:
      initialLocation - the initial starting location
      xExpression - the expression for the x axis
      zExpression - the expression for the y axis
  • Method Details

    • updateVariables

      public void updateVariables​(double x, double z, double t, double theta)
      Update the variables with new values.
      Parameters:
      x - the new x value
      z - the new y value
      t - the new value of "t", time (or tick)
      theta - the new theta value
    • executeExpression

      public void executeExpression​(org.bukkit.Particle particleType, int particleAmount, double xOffset, double yOffset, double zOffset, double particleExtra)
      Execute the particle shape definition expressions with current values. To update values, see updateVariables(double, double, double, double).
      Parameters:
      particleType - the type of particle to display
      particleAmount - the amount of particles to display
      xOffset - the x offset for each particle
      yOffset - the y offset for each particle
      zOffset - the z offset for each particle
      particleExtra - the extra value of the particle (generally speed, though this is dependent on the type of particle used)