Class AnimatedCircleEffect


public class AnimatedCircleEffect extends YPREffect
  • Field Details

    • xRotation

      public float xRotation
      Rotation of the torus.
    • yRotation

      public float yRotation
      Rotation of the torus.
    • zRotation

      public float zRotation
      Rotation of the torus.
    • angularVelocityX

      public double angularVelocityX
      Turns the circle by this angle each iteration around the x-axis
    • angularVelocityY

      public double angularVelocityY
      Turns the circle by this angle each iteration around the y-axis
    • angularVelocityZ

      public double angularVelocityZ
      Turns the circle by this angle each iteration around the z-axis
    • radius

      public float radius
      Radius of circle above head
    • maxAngle

      public double maxAngle
      Used to make a partial circle
    • resetCircle

      public boolean resetCircle
      Start at the same origin each step, use this along with maxAngle and wholeCircle to form persistent semicircles
    • enableRotation

      public boolean enableRotation
      Should it rotate?
    • particles

      public int particles
      Amount of particles per circle
    • wholeCircle

      public boolean wholeCircle
      To make a whole circle each iteration
    • radiusGrow

      public float radiusGrow
      Growth in blocks per iteration on the radius Setting to zero will disable it and fall back to the normal radius
    • step

      protected float step
      Current step. Works as a counter
  • Constructor Details

    • AnimatedCircleEffect

      public AnimatedCircleEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin, float yaw, float pitch, int particles_per_circle, float radius, float radiusGrow, double maxAngle, boolean wholeCircle, boolean resetCircle, boolean enableRotation, net.minecraft.util.math.Vec3d angularVelocity, net.minecraft.util.math.Vec3d rotations)
      Creates a new circle 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 center point of the circle
      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()
      particles_per_circle - Number of particles that make up each circle
      radius - The radius of the circle
      radiusGrow - Radius growth amount per each iteration. Setting to 0 won't make the radius grow. It can be used to make spirals instead of circles.
      maxAngle - Used to make a partial circle. Expressed in radians
      wholeCircle - Makes a whole circle every iteration. If disabled there will be an animation of particles completing the circle, similar to AnimatedBallEffect or a "loading" circle
      resetCircle - Start at the same origin each step, use this along with maxAngle and wholeCircle to form persistent semicircles. (If you have wholeCircle on false it won't work)
      enableRotation - Should the circle rotate?
      angularVelocity - A Vec3d of the angular velocities of the effect (for the rotation) expressed in radials. Turns the circle by this angle each iteration around the (x|y|z)-axis Tip: It also works with restCircle, and it creates interesting shapes! It can also work a bit like the animated ball!
      rotations - A Vec3d of Rotations of the torus/circles
    • AnimatedCircleEffect

      public AnimatedCircleEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin, float yaw, float pitch)
      Creates a new circle 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 center point of the circle
      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()
    • AnimatedCircleEffect

      public AnimatedCircleEffect(net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d origin)
      Creates a new circle 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 center point of the circle
  • Method Details

    • builder

      public static AnimatedCircleEffect.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!

    • copy

      public static void copy(AnimatedCircleEffect original, AnimatedCircleEffect copy)
    • onRun

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

      public float getRadius()
    • setRadius

      public void setRadius(float radius)
    • getMaxAngle

      public double getMaxAngle()
    • setMaxAngle

      public void setMaxAngle(double maxAngle)
    • isResetCircle

      public boolean isResetCircle()
    • setResetCircle

      public void setResetCircle(boolean resetCircle)
    • isEnableRotation

      public boolean isEnableRotation()
    • setEnableRotation

      public void setEnableRotation(boolean enableRotation)
    • getParticles

      public int getParticles()
    • setParticles

      public void setParticles(int particles)
    • isWholeCircle

      public boolean isWholeCircle()
    • setWholeCircle

      public void setWholeCircle(boolean wholeCircle)
    • getRadiusGrow

      public float getRadiusGrow()
    • setRadiusGrow

      public void setRadiusGrow(float radiusGrow)
    • getRotations

      public net.minecraft.util.math.Vec3d getRotations()
    • setRotations

      public void setRotations(net.minecraft.util.math.Vec3d rotations)
    • setAngularVelocity

      public void setAngularVelocity(net.minecraft.util.math.Vec3d angularVelocity)