use of com.mcmoddev.orespawn.api.os3.OreSpawnBlockMatcher in project OreSpawn by MinecraftModDevelopmentMods.
the class FeatureBase method spawnMungeSW.
protected void spawnMungeSW(World world, BlockPos blockPos, int rSqr, double radius, ISpawnEntry spawnData, int count) {
Random prng = this.random;
int quantity = count;
IBlockList possibleOres = spawnData.getBlocks();
OreSpawnBlockMatcher replacer = spawnData.getMatcher();
for (int dy = (int) (-1 * radius); dy < radius; dy++) {
for (int dx = (int) (radius); dx >= (int) (-1 * radius); dx--) {
for (int dz = (int) (radius); dz >= (int) (-1 * radius); dz--) {
if ((dx * dx + dy * dy + dz * dz) <= rSqr) {
IBlockState oreBlock = possibleOres.getRandomBlock(prng);
spawnOrCache(world, blockPos.add(dx, dy, dz), replacer, oreBlock, true, world.provider.getDimension(), spawnData);
quantity--;
}
if (quantity <= 0) {
return;
}
}
}
}
}
use of com.mcmoddev.orespawn.api.os3.OreSpawnBlockMatcher in project OreSpawn by MinecraftModDevelopmentMods.
the class FeatureBase method spawnMungeNE.
protected void spawnMungeNE(World world, BlockPos blockPos, int rSqr, double radius, ISpawnEntry spawnData, int count) {
Random prng = this.random;
int quantity = count;
IBlockList possibleOres = spawnData.getBlocks();
OreSpawnBlockMatcher replacer = spawnData.getMatcher();
for (int dy = (int) (-1 * radius); dy < radius; dy++) {
for (int dz = (int) (-1 * radius); dz < radius; dz++) {
for (int dx = (int) (-1 * radius); dx < radius; dx++) {
if ((dx * dx + dy * dy + dz * dz) <= rSqr) {
IBlockState oreBlock = possibleOres.getRandomBlock(prng);
spawnOrCache(world, blockPos.add(dx, dy, dz), replacer, oreBlock, true, world.provider.getDimension(), spawnData);
quantity--;
}
if (quantity <= 0) {
return;
}
}
}
}
}
Aggregations