@@ -108,7 +108,7 @@ private boolean spawnOrCache(World world, BlockPos coord, List<IBlockState> bloc
108
108
IBlockState targetBlock = world .getBlockState (coord );
109
109
110
110
if (canReplace (targetBlock , blockReplace )) {
111
- world .setBlockState (coord , oreBlock , 22 );
111
+ world .setBlockState (coord , oreBlock ); // , 22);
112
112
return true ;
113
113
} else {
114
114
return false ;
@@ -229,33 +229,47 @@ protected int getPoint(int lowerBound, int upperBound, int median) {
229
229
return t - median ;
230
230
}
231
231
232
-
233
- protected void spawnMunge ( FunctionParameterWrapper params , double radius , int count , boolean toPositive ) {
234
- int rSqr = ( int )( radius * radius ) ;
232
+ protected void spawnMungeSW ( World world , BlockPos blockPos , int rSqr , double radius ,
233
+ List < IBlockState > replaceBlock , int count , OreList possibleOres ) {
234
+ Random prng = this . random ;
235
235
int quantity = count ;
236
-
237
- OreList possible = params .getOres ();
238
- World world = params .getWorld ();
239
- BlockPos blockPos = params .getBlockPos ();
240
- List <IBlockState > replace = params .getReplacements ();
241
- BiomeLocation biomes = params .getBiomes ();
242
-
243
- for (int dy = (int )(-1 * radius ); dy < radius ; dy ++) {
244
- for (int dx = getStart (toPositive , radius ); endCheck (toPositive , dx , radius ); dx = countItem (dx , toPositive )) {
245
- for (int dz = getStart (toPositive , radius ); endCheck (toPositive , dz , radius ); dz = countItem (dz , toPositive )) {
246
- if (getABC (dx , dy , dz ) <= rSqr ) {
247
- IBlockState oreBlock = possible .getRandomOre (this .random ).getOre ();
248
- spawn (oreBlock , world , blockPos .add (dx , dy , dz ), world .provider .getDimension (), true , replace , biomes );
249
-
250
- if (--quantity <= 0 ) {
251
- return ;
252
- }
236
+ for (int dy = (int )(-1 * radius ); dy < radius ; dy ++){
237
+ for (int dx = (int )(radius ); dx >= (int )(-1 * radius ); dx --){
238
+ for (int dz = (int )(radius ); dz >= (int )(-1 * radius ); dz --){
239
+ if ((dx *dx + dy *dy + dz *dz ) <= rSqr ){
240
+ IBlockState oreBlock = possibleOres .getRandomOre (prng ).getOre ();
241
+ spawnOrCache (world ,blockPos .add (dx ,dy ,dz ),replaceBlock , oreBlock , true , world .provider .getDimension ());
242
+ quantity --;
243
+ }
244
+ if (quantity <= 0 ) {
245
+ return ;
253
246
}
254
247
}
255
248
}
256
249
}
257
250
}
258
251
252
+
253
+ protected void spawnMungeNE (World world , BlockPos blockPos , int rSqr , double radius ,
254
+ List <IBlockState > replaceBlock , int count , OreList possibleOres ) {
255
+ Random prng = this .random ;
256
+ int quantity = count ;
257
+ for (int dy = (int )(-1 * radius ); dy < radius ; dy ++){
258
+ for (int dz = (int )(-1 * radius ); dz < radius ; dz ++){
259
+ for (int dx = (int )(-1 * radius ); dx < radius ; dx ++){
260
+ if ((dx *dx + dy *dy + dz *dz ) <= rSqr ){
261
+ IBlockState oreBlock = possibleOres .getRandomOre (prng ).getOre ();
262
+ spawnOrCache (world ,blockPos .add (dx ,dy ,dz ),replaceBlock , oreBlock , true , world .provider .getDimension ());
263
+ quantity --;
264
+ }
265
+ if (quantity <= 0 ) {
266
+ return ;
267
+ }
268
+ }
269
+ }
270
+ }
271
+ }
272
+
259
273
protected int getABC (int dx , int dy , int dz ) {
260
274
return (dx * dx + dy * dy + dz * dz );
261
275
}
0 commit comments