use of mcjty.lib.container.BaseBlock in project RFToolsDimensions by McJty.
the class GenericWorldGenerator method generate.
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
RfToolsDimensionManager manager = RfToolsDimensionManager.getDimensionManager(world);
if (manager.getDimensionDescriptor(world.provider.getDimension()) == null) {
// Not an RFTools dimension
return;
}
DimensionInformation information = manager.getDimensionInformation(world.provider.getDimension());
IBlockState baseBlock = information.getBaseBlockForTerrain();
if (information.hasFeatureType(FeatureType.FEATURE_OREGEN)) {
for (IBlockState block : information.getExtraOregen()) {
addOreSpawn(block, baseBlock, world, random, chunkX * 16, chunkZ * 16, 7, 10, 12, 2, 60);
}
}
Block dimensionalShardBlock = ForgeRegistries.BLOCKS.getValue(new ResourceLocation("rftools", "dimensional_shard_ore"));
addOreSpawn(dimensionalShardBlock.getDefaultState(), Blocks.STONE.getDefaultState(), world, random, chunkX * 16, chunkZ * 16, WorldgenConfiguration.oreMinimumVeinSize, WorldgenConfiguration.oreMaximumVeinSize, WorldgenConfiguration.oreMaximumVeinCount, WorldgenConfiguration.oreMinimumHeight, WorldgenConfiguration.oreMaximumHeight);
if (information.isPatreonBitSet(PatreonType.PATREON_PUPPETEER) && Math.abs(chunkX) <= 1 && Math.abs(chunkZ) <= 1) {
generateBigSpawnPlatform(world, chunkX, chunkZ, puppeteerSpawnPlatform);
} else if (chunkX == 0 && chunkZ == 0) {
generateSpawnPlatform(world);
} else if ((Math.abs(chunkX) > 6 || Math.abs(chunkZ) > 6) && !information.hasFeatureType(FeatureType.FEATURE_NODIMLETBUILDINGS)) {
// Not too close to starting platform we possibly generate dungeons.
if (random.nextInt(WorldgenConfiguration.dungeonChance) == 1) {
generateDimletDungeon(random, chunkX, chunkZ, world);
}
}
if ((Math.abs(chunkX) >= 2 || Math.abs(chunkZ) >= 2) && information.isPatreonBitSet(PatreonType.PATREON_COLOREDPRISMS)) {
if (random.nextInt(10) == 1) {
generatePrism(chunkX, chunkZ, world);
}
}
if ((Math.abs(chunkX) >= 1 || Math.abs(chunkZ) >= 1) && information.isPatreonBitSet(PatreonType.PATREON_PINKPILLARS)) {
if (random.nextInt(2) == 1) {
generatePillar(random, chunkX, chunkZ, world);
}
}
if ((Math.abs(chunkX) >= 3 || Math.abs(chunkZ) >= 3) && information.hasFeatureType(FeatureType.FEATURE_VOLCANOES)) {
if (random.nextInt(WorldgenConfiguration.volcanoChance) == 1) {
generateVolcano(random, chunkX, chunkZ, world);
}
}
if (information.getTerrainType() == TerrainType.TERRAIN_LOSTCITIES) {
generateLootSpawners(random, chunkX, chunkZ, world);
generateVines(random, chunkX, chunkZ, world);
}
}
Aggregations