public class ConeEffect extends YPREffect
  • Field Details

    • lengthGrow

      public float lengthGrow
      Growing per iteration in the length (0.05)
    • angularVelocity

      public double angularVelocity
      Radials per iteration to spawn the next particle (PI / 16)
    • particles

      public int particles
      Cone-particles per interation (10)
    • radiusGrow

      public float radiusGrow
      Growth in blocks per iteration on the radius (0.006)
    • particlesCone

      public int particlesCone
      Conesize in particles per cone
    • rotation

      public double rotation
      Start-angle or rotation of the cone
    • randomize

      public boolean randomize
      Randomize every cone on creation (false)
    • solid

      public boolean solid
      Solid cone
    • strands

      public int strands
      Amount of strands
    • flipped

      public boolean flipped
      Flips the cone from the origin to the center of the predicted ending position

      Experimental! May not work as intended

    • inverted

      public boolean inverted
      Inverts the cone making it start from the last position and go all the way to the origin. Not to be cofused with flipped
    • drawCenterAxis

      public boolean drawCenterAxis
      Do you want to draw the center axis as well?
    • drawFinishPoint

      public boolean drawFinishPoint
      Draws a point (one particle) where the effect ends
    • secondaryParticle

      public net.minecraft.particle.ParticleEffect secondaryParticle
      The particles to use for displaying the center axis/finish point Falls back to the particle of this effect
    • step

      protected int step
      Current step. Works as counter
  • Constructor Details

    • ConeEffect

      public ConeEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin, float yaw, float pitch, int particleConeSize, int particlesPerIteration, int strands_number, float lengthGrow, float radiusGrow, double angularVel, double startRotation, boolean solid, boolean random)
      Creates a new cone effect
      Parameters:
      world - The world the particles are going to spawn in
      particle - The particle effect that is going to be spawned. You can use ParticleTypes
      origin - The origin position of the effect, aka the starting point of the cone
      yaw - The yaw of the effect. For example, you can get it from an Entity using getYaw()
      pitch - The pitch of the effect. For example, you can get it from an Entity using getPitch()
      particleConeSize - By how many particles should the cone be made of
      particlesPerIteration - How many particles to display per iteration
      strands_number - The number of the strands
      lengthGrow - Length growth amount per each iteration
      radiusGrow - Radius growth amount per each iteration
      angularVel - The angular velocity of the effect expressed in radials per iteration, to spawn the next particle
      startRotation - The starting rotation angle of the cone
      solid - Should the cone be solid?
      random - Makes the initial rotation of the cone random
    • ConeEffect

      public ConeEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin, float yaw, float pitch)
      Creates a new cone effect
      Parameters:
      world - The world the particles are going to spawn in
      particle - The particle effect that is going to be spawned. You can use ParticleTypes
      origin - The origin position of the effect, aka the starting point of the cone
      yaw - The yaw of the effect. For example, you can get it from an Entity using getYaw()
      pitch - The pitch of the effect. For example, you can get it from an Entity using getPitch()
    • ConeEffect

      public ConeEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin)
      Creates a new cone effect
      Parameters:
      world - The world the particles are going to spawn in
      particle - The particle effect that is going to be spawned. You can use ParticleTypes
      origin - The origin position of the effect, aka the starting point of the cone
  • Method Details

    • copy

      public static void copy(ConeEffect original, ConeEffect copy)
    • builder

      public static ConeEffect.Builder builder(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d originPos)
      Returns a builder for the effect.
      Parameters:
      world - The world the particles are going to spawn in
      particle - The particle effect that is going to be spawned. You can use ParticleTypes
      originPos - The origin position of the effect

      Setting a world, a particle effect and an origin position is ALWAYS mandatory, hence their presence in this method! If this is an effect that uses Yaw and Pitch, remember to set those as well!

    • getPredictedMaxCenterPosition

      public net.minecraft.util.math.Vec3d getPredictedMaxCenterPosition()
      Returns the position of the center of the cone at it maximum point

      Experimental! May not work as intended if run for more or less than 10 seconds!

    • onRun

      protected void onRun()
      Description copied from class: Effect
      Main method to extend, here the animation code is run EACH tick
      Overrides:
      onRun in class Effect
    • getLengthGrow

      public float getLengthGrow()
    • setLengthGrow

      public void setLengthGrow(float lengthGrow)
    • getAngularVelocity

      public double getAngularVelocity()
    • setAngularVelocity

      public void setAngularVelocity(double angularVelocity)
    • getParticles

      public int getParticles()
    • setParticles

      public void setParticles(int particles)
    • getRadiusGrow

      public float getRadiusGrow()
    • setRadiusGrow

      public void setRadiusGrow(float radiusGrow)
    • getParticlesCone

      public int getParticlesCone()
    • setParticlesCone

      public void setParticlesCone(int particlesCone)
    • getRotation

      public double getRotation()
    • setRotation

      public void setRotation(double rotation)
    • isRandomize

      public boolean isRandomize()
    • setRandomize

      public void setRandomize(boolean randomize)
    • isSolid

      public boolean isSolid()
    • setSolid

      public void setSolid(boolean solid)
    • getStrands

      public int getStrands()
    • setStrands

      public void setStrands(int strands)
    • isFlipped

      public boolean isFlipped()
    • setFlipped

      public void setFlipped(boolean flipped)
    • isInverted

      public boolean isInverted()
    • setInverted

      public void setInverted(boolean inverted)
    • isDrawCenterAxis

      public boolean isDrawCenterAxis()
    • setDrawCenterAxis

      public void setDrawCenterAxis(boolean drawCenterAxis)
    • getSecondaryParticle

      public net.minecraft.particle.ParticleEffect getSecondaryParticle()
    • setSecondaryParticle

      public void setSecondaryParticle(net.minecraft.particle.ParticleEffect secondaryParticle)
    • isDrawFinishPoint

      public boolean isDrawFinishPoint()
    • setDrawFinishPoint

      public void setDrawFinishPoint(boolean drawFinishPoint)