Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup chunkgen & reduce the size and number of oceans #79

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions src/datagen/java/moriyashiine/aylyth/datagen/AylythDatagen.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import moriyashiine.aylyth.datagen.common.world.structure.AylythStructurePoolBootstrap;
import moriyashiine.aylyth.datagen.common.world.structure.AylythStructureSetBootstrap;
import moriyashiine.aylyth.datagen.common.world.terrain.AylythDensityFunctionBootstrap;
import moriyashiine.aylyth.datagen.common.world.terrain.AylythNoiseSettingBootstrap;
import moriyashiine.aylyth.datagen.common.world.terrain.AylythNoiseTypeBootstrap;
import moriyashiine.aylyth.datagen.common.world.terrain.AylythChunkGenSettingsBootstrap;
import moriyashiine.aylyth.datagen.common.world.terrain.AylythNoiseParamsBootstrap;
import moriyashiine.aylyth.datagen.common.loot.AylythBlockLootProvider;
import moriyashiine.aylyth.datagen.common.loot.AylythEntityLootProvider;
import moriyashiine.aylyth.datagen.common.tag.*;
Expand Down Expand Up @@ -61,23 +61,23 @@ public void onInitializeDataGenerator(FabricDataGenerator dataGenerator) {
}

@Override
public void buildRegistry(RegistryBuilder registryBuilder) {
registryBuilder.addRegistry(RegistryKeys.NOISE_PARAMETERS, AylythNoiseTypeBootstrap::bootstrap);
registryBuilder.addRegistry(RegistryKeys.DENSITY_FUNCTION, AylythDensityFunctionBootstrap::bootstrap);
registryBuilder.addRegistry(RegistryKeys.CHUNK_GENERATOR_SETTINGS, AylythNoiseSettingBootstrap::bootstrap);
registryBuilder.addRegistry(RegistryKeys.CONFIGURED_CARVER, AylythConfiguredCarverBootstrap::bootstrap);
registryBuilder.addRegistry(RegistryKeys.CONFIGURED_FEATURE, AylythConfiguredFeatureBootstrap::bootstrap);
registryBuilder.addRegistry(RegistryKeys.PLACED_FEATURE, AylythPlacedFeatureBootstrap::bootstrap);
registryBuilder.addRegistry(RegistryKeys.TEMPLATE_POOL, AylythStructurePoolBootstrap::bootstrap);
registryBuilder.addRegistry(RegistryKeys.STRUCTURE, AylythStructureBootstrap::bootstrap);
registryBuilder.addRegistry(RegistryKeys.STRUCTURE_SET, AylythStructureSetBootstrap::bootstrap);
registryBuilder.addRegistry(RegistryKeys.BIOME, AylythBiomeBootstrap::bootstrap);
registryBuilder.addRegistry(RegistryKeys.DAMAGE_TYPE, AylythDamageTypeBootstrap::bootstrap);
registryBuilder.addRegistry(AylythRegistryKeys.LOOT_TABLE_DISPLAY, LootDisplayBootstrap::bootstrap);
public void buildRegistry(RegistryBuilder builder) {
builder.addRegistry(RegistryKeys.NOISE_PARAMETERS, AylythNoiseParamsBootstrap::bootstrap);
builder.addRegistry(RegistryKeys.DENSITY_FUNCTION, AylythDensityFunctionBootstrap::bootstrap);
builder.addRegistry(RegistryKeys.CHUNK_GENERATOR_SETTINGS, AylythChunkGenSettingsBootstrap::bootstrap);
builder.addRegistry(RegistryKeys.CONFIGURED_CARVER, AylythConfiguredCarverBootstrap::bootstrap);
builder.addRegistry(RegistryKeys.CONFIGURED_FEATURE, AylythConfiguredFeatureBootstrap::bootstrap);
builder.addRegistry(RegistryKeys.PLACED_FEATURE, AylythPlacedFeatureBootstrap::bootstrap);
builder.addRegistry(RegistryKeys.TEMPLATE_POOL, AylythStructurePoolBootstrap::bootstrap);
builder.addRegistry(RegistryKeys.STRUCTURE, AylythStructureBootstrap::bootstrap);
builder.addRegistry(RegistryKeys.STRUCTURE_SET, AylythStructureSetBootstrap::bootstrap);
builder.addRegistry(RegistryKeys.BIOME, AylythBiomeBootstrap::bootstrap);
builder.addRegistry(RegistryKeys.DAMAGE_TYPE, AylythDamageTypeBootstrap::bootstrap);
builder.addRegistry(AylythRegistryKeys.LOOT_TABLE_DISPLAY, LootDisplayBootstrap::bootstrap);
}

@Override
public @Nullable String getEffectiveModId() {
public String getEffectiveModId() {
return Aylyth.MOD_ID;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package moriyashiine.aylyth.datagen.common.world.terrain;

import moriyashiine.aylyth.common.data.world.AylythDimensionData;
import net.minecraft.block.Blocks;
import net.minecraft.registry.Registerable;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.world.biome.source.util.MultiNoiseUtil.NoiseHypercube;
import net.minecraft.world.gen.chunk.ChunkGeneratorSettings;
import net.minecraft.world.gen.chunk.GenerationShapeConfig;
import net.minecraft.world.gen.noise.NoiseRouter;

import java.util.List;

import static moriyashiine.aylyth.common.data.world.AylythDimensionData.*;
import static moriyashiine.aylyth.common.data.world.terrain.AylythDensityFunctions.*;
import static moriyashiine.aylyth.datagen.common.world.terrain.AylythDensityFunctionBootstrap.wrap;
import static net.minecraft.world.gen.densityfunction.DensityFunctionTypes.*;

public final class AylythChunkGenSettingsBootstrap {
private AylythChunkGenSettingsBootstrap() {}

public static void bootstrap(Registerable<ChunkGeneratorSettings> context) {
var densityFuns = context.getRegistryLookup(RegistryKeys.DENSITY_FUNCTION);

// VANILLACOPY ChunkGeneratorSettings.OVERWORLD
// Changed world height, vertical size 2 -> 1, no aquifer barriers, no lava, no ore veins, sea level 63 -> 47

var shapeConfig = new GenerationShapeConfig(MIN_HEIGHT, SHAPE_MAX_HEIGHT, 1, 1);
var noiseRouter = new NoiseRouter(
zero(),
wrap(densityFuns.getOrThrow(AQUIFER_FLUID_FLOODEDNESS)),
wrap(densityFuns.getOrThrow(AQUIFER_FLUID_SPREAD)),
zero(),
wrap(densityFuns.getOrThrow(TEMPERATURE)),
wrap(densityFuns.getOrThrow(VEGETATION)),
wrap(densityFuns.getOrThrow(CONTINENTS)),
wrap(densityFuns.getOrThrow(EROSION)),
wrap(densityFuns.getOrThrow(DEPTH)),
wrap(densityFuns.getOrThrow(RIDGES)),
wrap(densityFuns.getOrThrow(DENSITY_INITIAL_WITHOUT_JAGGEDNESS)),
wrap(densityFuns.getOrThrow(DENSITY_FINAL)),
zero(),
zero(),
zero()
);
var surfaceMaterialRules = AylythSurfaceMaterialRules.build();
var spawnTarget = List.<NoiseHypercube>of();
var seaLevel = 47;

context.register(AylythDimensionData.CHUNK_GEN_SETTINGS, new ChunkGeneratorSettings(shapeConfig, Blocks.DEEPSLATE.getDefaultState(), Blocks.WATER.getDefaultState(), noiseRouter, surfaceMaterialRules, spawnTarget, seaLevel, false, true, false, false));
}
}
Loading
Loading