mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
34 lines
689 B
Java
34 lines
689 B
Java
package com.hbm.world;
|
|
|
|
import com.hbm.blocks.ModBlocks;
|
|
|
|
import net.minecraft.init.Blocks;
|
|
import net.minecraft.world.World;
|
|
|
|
public class OilBubble {
|
|
|
|
public static void spawnOil(World world, int x, int y, int z, int radius) {
|
|
int r = radius;
|
|
int r2 = r * r;
|
|
int r22 = r2 / 2;
|
|
|
|
for (int xx = -r; xx < r; xx++) {
|
|
int X = xx + x;
|
|
int XX = xx * xx;
|
|
for (int yy = -r; yy < r; yy++) {
|
|
int Y = yy + y;
|
|
int YY = XX + yy * yy * 3;
|
|
for (int zz = -r; zz < r; zz++) {
|
|
int Z = zz + z;
|
|
int ZZ = YY + zz * zz;
|
|
if (ZZ < r22) {
|
|
if(world.getBlock(X, Y, Z) == Blocks.stone)
|
|
world.setBlock(X, Y, Z, ModBlocks.ore_oil);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|