@@ -1442,20 +1442,24 @@ public static BukkitTask atomic(Plugin plugin, int orbits, double radius, double
14421442    /** 
14431443     * Spawns animated helix shapes. 
14441444     * 
1445-      * @param strings   the amount of helix strings. The rotation angle will split equally for each. 
1446-      * @param radius    the radius of the helix. 
1447-      * @param rate      the rate of helix points. 
1448-      * @param extension the helix circle extension. 
1449-      * @param length    the length of the helix. 
1450-      * @param speed     the speed of the rate builder in each animation tick. 
1451-      * @param fadeUp    helix radius will decrease to zero as it gets closer to the top. 
1452-      * @param fadeDown  helix radius will increase to the original radius as it gets closer to the center. 
1445+      * @param strings      the amount of helix strings. The rotation angle will split equally for each. 
1446+      * @param radius       the radius of the helix. 
1447+      * @param rate         the rate of helix points. 
1448+      * @param extension    the helix circle extension. 
1449+      * @param length       the length of the helix. 
1450+      * @param speed        the amount of blocks the particles advances in one tick. Recommended is 0.5 
1451+      * @param rotationRate The amount particles rotate around the circular reference, should be set depending on the amount of strings. 
1452+      *                     5 is usually a good value. 
1453+      * @param fadeUp       helix radius will decrease to zero as it gets closer to the top. 
1454+      * @param fadeDown     helix radius will increase to the original radius as it gets closer to the center. 
14531455     * @return the animation runnable. It will return false when the animation is finished. 
14541456     * @see #dnaReplication(double, double, int, double, int, int, ParticleDisplay) 
14551457     * @since 3.0.0 
14561458     */ 
1457-     public  static  BooleanSupplier  helix (int  strings , double  radius , double  rate , double  extension , int  length , int  speed ,
1458-                                         boolean  fadeUp , boolean  fadeDown , ParticleDisplay  display ) {
1459+     public  static  BooleanSupplier  helix (int  strings , double  radius , double  rate , double  extension ,
1460+                                         double  length , double  speed , double  rotationRate ,
1461+                                         boolean  fadeUp , boolean  fadeDown ,
1462+                                         ParticleDisplay  display ) {
14591463        return  new  BooleanSupplier () {
14601464            // If we look at a helix string from above, we'll see a circle tunnel. 
14611465            // To make this tunnel we're going to generate circles while moving 
@@ -1467,17 +1471,13 @@ public static BooleanSupplier helix(int strings, double radius, double rate, dou
14671471            final  double  radiusDiv2  = fadeUp  && fadeDown  ? radiusDiv  * 2  : radiusDiv ;
14681472            double  dynamicRadius  = fadeDown  ? 0  : radius ;
14691473            boolean  center  = !fadeDown ;
1470-             final  double  rotationRate  = distanceBetweenEachCirclePoints  / 5 ;
1474+             final  double  calculatedRotRate  = distanceBetweenEachCirclePoints  / rotationRate ;
14711475            double  rotation  = 0 ;
1472-             final   boolean   done  =  false ;
1476+             double   currentDistance  =  0 ;
14731477
14741478            @ Override 
14751479            public  boolean  getAsBoolean () {
1476-                 if  (done ) return  false ;
1477- 
1478- //                int repeat = speed; 
1479- //                while (repeat-- > 0) { 
1480- //                    y += rate; 
1480+                 if  (currentDistance  >= length ) return  false ;
14811481
14821482                if  (!center ) {
14831483                    dynamicRadius  += radiusDiv2 ;
@@ -1493,13 +1493,10 @@ public boolean getAsBoolean() {
14931493                    display .spawn (x , 0 , z );
14941494                }
14951495
1496-                 display .advanceInDirection (1 );
1497-                 rotation  += rotationRate ;
1498- //                if (y > length) { 
1499- //                    done = true; 
1500- //                    return false; 
1501- //                } 
1502- //                } 
1496+                 currentDistance  += speed ;
1497+                 if  (currentDistance  < length ) display .advanceInDirection (speed );
1498+                 else  display .advanceInDirection (speed  - (currentDistance  - length ));
1499+                 rotation  += calculatedRotRate ;
15031500
15041501                return  true ;
15051502            }
@@ -1522,9 +1519,10 @@ public boolean getAsBoolean() {
15221519     * @see #dnaReplication(Plugin, double, double, int, double, int, int, ParticleDisplay) 
15231520     * @since 3.0.0 
15241521     */ 
1525-     public  static  BukkitTask  helix (Plugin  plugin , int  strings , double  radius , double  rate , double  extension , int  height , int  speed ,
1522+     public  static  BukkitTask  helix (Plugin  plugin , int  strings , double  radius , double  rate ,
1523+                                    double  extension , double  height , double  speed , double  rotationRate ,
15261524                                   boolean  fadeUp , boolean  fadeDown , ParticleDisplay  display ) {
1527-         BooleanSupplier  helix  = helix (strings , radius , rate , extension , height , speed , fadeUp , fadeDown , display );
1525+         BooleanSupplier  helix  = helix (strings , radius , rate , extension , height , speed , rotationRate ,  fadeUp , fadeDown , display );
15281526        return  new  BukkitRunnable () {
15291527            @ Override 
15301528            public  void  run () {
@@ -1603,7 +1601,7 @@ public static void lightning(Location start, Vector direction, int entries, int
16031601     * @param hydrogenBondDist    the distance between each hydrogen bond (read inside method). This distance is also affected by rate. 
16041602     * @param display             display for strings. 
16051603     * @param hydrogenBondDisplay display for hydrogen bonds. 
1606-      * @see #helix(Plugin, int , double, double, double, int, int , boolean, boolean, ParticleDisplay) 
1604+      * @see #helix(int, double , double, double, double, double, double , boolean, boolean, ParticleDisplay) 
16071605     * @see #dnaReplication(Plugin, double, double, int, double, int, int, ParticleDisplay) 
16081606     * @since 1.0.0 
16091607     */ 
0 commit comments