@@ -64,8 +64,9 @@ protected void recursiveGenerate(World world, int chunkX, int chunkZ, int p_1807
6464 int [] sinCoefficients = {rand .nextInt (10 ) + 1 , rand .nextInt (10 ) + 1 , rand .nextInt (10 ) + 1 , rand .nextInt (10 ) + 1 , rand .nextInt (10 ) + 1 };
6565 //Radius determination, with heavy weight towards smaller craters
6666 int baseRadius = getBaseRadius (rand .nextInt (400 ));
67- //Perturbation # calculation
67+ //Perturbation # calculation && center spire boolean
6868 int numBulges = rand .nextInt (5 ) + 1 ;
69+ boolean spire = rand .nextInt (4 ) == 0 ;
6970
7071 //Turn the coordinates from chunk stuff into their actual values
7172 int xCoord = -chunkX + p_180701_4_ ;
@@ -103,7 +104,7 @@ protected void recursiveGenerate(World world, int chunkX, int chunkZ, int p_1807
103104 //Standard inversePartialSquareRadius & blockRadius stuff
104105 int distancesSquared = ((xCoord * 16 ) + x ) * ((xCoord * 16 ) + x ) + ((zCoord * 16 ) + z ) * ((zCoord * 16 ) + z );
105106 int blockRadius = (int )Math .sqrt (distancesSquared );
106- int inversePartialSquareRadius = (radius *radius - distancesSquared ) / (radius * 4 );
107+ int inversePartialSquareRadius = (int )(( radius *radius - distancesSquared ) / (baseRadius * (( baseRadius > 256 ) ? 4 : ( baseRadius > 128 ) ? 3 : 2.25 )) );
107108 int inverseRadius = radius - blockRadius ;
108109
109110 //Places filler blocks to excavate the crater
@@ -119,16 +120,16 @@ protected void recursiveGenerate(World world, int chunkX, int chunkZ, int p_1807
119120 //The graph of this function and the old one can be found here https://www.desmos.com/calculator/x02rgy2wlf
120121 for (int dist = -1 ; dist < 9 * ridgeSize * ((1 - inverseRadius )/(0.8 * radius + (inverseRadius - 1 ) * (inverseRadius - 1 ))) - 1.06 ; dist ++) {
121122 //Place the bank thrown up by the impact, and have some of the farthest be dispersed
122- if (y + dist < 255 && inverseRadius > -0.5 * radius )
123+ if (y + dist < 255 && inverseRadius > -0.75 * radius )
123124 chunkPrimerIn .setBlockState (x , y + dist , z , this .getBlockToPlace (world , chunkX , chunkZ , ores ));
124- else if (y + dist < 255 && inverseRadius >= -0.625 * radius && !(rand .nextInt (inverseRadius + (int )(radius * 0.625 ) + 1 ) == 0 ))
125+ else if (y + dist < 255 && inverseRadius >= -0.875 * radius && !(rand .nextInt (inverseRadius + (int )(radius * 0.875 ) + 1 ) == 0 ))
125126 chunkPrimerIn .setBlockState (x , y + dist , z , this .getBlockToPlace (world , chunkX , chunkZ , ores ));
126- else if (y + dist < 255 && inverseRadius < -0.625 * radius && rand .nextInt (Math .abs (inverseRadius + (int )(radius * 0.625 )) + 1 ) == 0 )
127+ else if (y + dist < 255 && inverseRadius < -0.875 * radius && rand .nextInt (Math .abs (inverseRadius + (int )(radius * 0.875 )) + 1 ) == 0 )
127128 chunkPrimerIn .setBlockState (x , y + dist , z , this .getBlockToPlace (world , chunkX , chunkZ , ores ));
128129
129130 //Ejecta blocks on top, then ejecta blocks below farther out
130131 if (rand .nextInt (Math .abs (inverseRadius ) + 1 ) == 0 ) {
131- if (inverseRadius < -0.25 * radius && inverseRadius > -1.5 * radius )
132+ if (inverseRadius < -0.375 * radius && inverseRadius > -1.5 * radius )
132133 chunkPrimerIn .setBlockState (x , y + dist + 1 , z , this .getBlockToPlace (world , chunkX , chunkZ , ores ));
133134 else if (inverseRadius < -1.5 * radius )
134135 chunkPrimerIn .setBlockState (x , y + dist + 1 + rand .nextInt (2 ), z , this .getBlockToPlace (world , chunkX , chunkZ , ores ));
@@ -145,8 +146,8 @@ else if (inverseRadius < -1.5 * radius)
145146
146147 //Place spire in the center of the bowl
147148 //An example of this graph is https://www.desmos.com/calculator/nn5xmzyu6i
148- if (blockRadius < 0.1 * radius ) {
149- for (int dist = 0 ; dist < (- 0.015625 * blockRadius * blockRadius ) + radius / 16 ; dist ++) {
149+ if (blockRadius < 0.25 * radius && spire ) {
150+ for (int dist = 0 ; dist < Math . pow ( Math . abs (-( radius / 16.0 ) + blockRadius / 4.0 ), 1.25 ) ; dist ++) {
150151 chunkPrimerIn .setBlockState (x , y + Math .min (dist , 16 ) - 27 , z , this .getBlockToPlaceRich (world , chunkX , chunkZ , ores ));
151152 }
152153
@@ -215,7 +216,7 @@ private int getRadius(int base, int x, int z, int bumps, int[] random) {
215216
216217 //Then we want to add some sin-function bumps to it, as determined by the bumps
217218 //They increase theta each time because then we can get different-placed perturbations
218- //An example graph for this is here: https://www.desmos.com/calculator/z4dsa5k1qv
219+ //An example graph for this is here: https://www.desmos.com/calculator/5ojoqscuxv
219220 int extras = 0 ;
220221 for (int i = 2 ; i < Math .min (5 , bumps ) + 2 ; i ++){
221222 extras += random [i -2 ] * base * Math .sin (i * radians ) * 0.0075 ;
0 commit comments