@@ -108,7 +108,7 @@ private boolean spawnOrCache(World world, BlockPos coord, List<IBlockState> bloc
108108 IBlockState targetBlock = world .getBlockState (coord );
109109
110110 if (canReplace (targetBlock , blockReplace )) {
111- world .setBlockState (coord , oreBlock , 22 );
111+ world .setBlockState (coord , oreBlock ); // , 22);
112112 return true ;
113113 } else {
114114 return false ;
@@ -229,33 +229,47 @@ protected int getPoint(int lowerBound, int upperBound, int median) {
229229 return t - median ;
230230 }
231231
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 ;
235235 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 ;
253246 }
254247 }
255248 }
256249 }
257250 }
258251
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+
259273 protected int getABC (int dx , int dy , int dz ) {
260274 return (dx * dx + dy * dy + dz * dz );
261275 }
0 commit comments