public class VortexEffect extends YPREffect
  • Field Details

    • radius

      public float radius
      Radius of vortex (2)
    • radiusGrow

      public float radiusGrow
      Radius grow per iteration (0.00)
    • startRange

      public float startRange
      Initial range of the vortex (0.0)
    • lengthGrow

      public float lengthGrow
      Growing per iteration (0.05)
    • radials

      public double radials
      Radials per iteration (PI / 16)
    • circles

      public int circles
      Helix-circles per iteration (3) (Also impacts on the length of the effect)
    • helixes

      public int helixes
      Amount of helices (4) Yay for the typo
    • flipped

      public boolean flipped
      Flips the staring and ending position of the vortex
    • inverted

      public boolean inverted
      Inverts the direction of the effect, making the particles appear from the max radius and end at the origin
    • step

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

    • VortexEffect

      public VortexEffect(@NotNull @NotNull net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d originPos, float yaw, float pitch, float radius, float radiusGrow, float startRange, float lengthGrow, double radials_per_iteration, int circles, int helixes)
      Creates a new Vortex 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
      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()
      radius - The base radius of the vortex
      radiusGrow - How much should the radius grow each iteration, aka each tick? TIP: Set it to a fairly low number
      startRange - The initial range of the vortex
      lengthGrow - The distance the vortex grows each tick
      radials_per_iteration - Radials per iteration
      circles - The number of circles per iteration
      helixes - The number of helixes or helices whatever per iteration
    • VortexEffect

      public VortexEffect(@NotNull @NotNull net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d originPos, float yaw, float pitch, float radius, float lengthGrow, int circles, int helixes)
      Creates a new Vortex 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
      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()
      radius - The base radius of the vortex
      lengthGrow - The distance the vortex grows each tick
      circles - The number of circles per iteration
      helixes - The number of helixes or helices whatever per iteration
    • VortexEffect

      public VortexEffect(@NotNull @NotNull net.minecraft.server.world.ServerWorld world, net.minecraft.particle.ParticleEffect particle, net.minecraft.util.math.Vec3d originPos, float yaw, float pitch)
      Creates a new Vortex 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
      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()
  • Method Details

    • builder

      public static VortexEffect.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 predicted finish center position of the vortex, can be used to invert the vortex
    • 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
    • getRadius

      public float getRadius()
    • setRadius

      public void setRadius(float radius)
    • getRadiusGrow

      public float getRadiusGrow()
    • copy

      public static void copy(VortexEffect original, VortexEffect copy)
    • setRadiusGrow

      public void setRadiusGrow(float radiusGrow)
    • getStartRange

      public float getStartRange()
    • setStartRange

      public void setStartRange(float startRange)
    • getLengthGrow

      public float getLengthGrow()
    • setLengthGrow

      public void setLengthGrow(float lengthGrow)
    • getRadials

      public double getRadials()
    • setRadials

      public void setRadials(double radials)
    • getCircles

      public int getCircles()
    • setCircles

      public void setCircles(int circles)
    • getHelixes

      public int getHelixes()
    • setHelixes

      public void setHelixes(int helixes)
    • isFlipped

      public boolean isFlipped()
    • setFlipped

      public void setFlipped(boolean flipped)
    • isInverted

      public boolean isInverted()
    • setInverted

      public void setInverted(boolean inverted)