Skip to content

Commit

Permalink
feat: rudimentary blight gen
Browse files Browse the repository at this point in the history
  • Loading branch information
Zepalesque committed Jan 5, 2025
1 parent c035ad6 commit 602db24
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ protected void gather() {

var biomeTints = this.builder(UnityBiomeTints.AETHER_GRASS.get().getDataMap());
biomeTints.add(ReduxBiomes.GILDED_GROVES, ReduxColors.Tints.GILDED_GRASS_COLOR, false);
biomeTints.add(ReduxBiomes.THE_BLIGHT, ReduxColors.Tints.BLIGHT_GRASS_COLOR, false);

var compostables = this.builder(NeoForgeDataMaps.COMPOSTABLES);
this.addCompost(compostables, ReduxBlocks.GILDENROOT_LEAVES, 0.3F);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
package net.zepalesque.redux.data.resource.builders.biome;

import com.aetherteam.aether.data.resources.AetherMobCategory;
import com.aetherteam.aether.data.resources.registries.AetherPlacedFeatures;
import com.aetherteam.aether.entity.AetherEntityTypes;
import net.minecraft.core.HolderGetter;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.BootstrapContext;
import net.minecraft.world.entity.MobCategory;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.biome.BiomeGenerationSettings;
import net.minecraft.world.level.biome.BiomeSpecialEffects;
import net.minecraft.world.level.biome.MobSpawnSettings;
import net.minecraft.world.level.levelgen.GenerationStep;
import net.minecraft.world.level.levelgen.carver.ConfiguredWorldCarver;
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
import net.zepalesque.redux.client.audio.ReduxMusic;
import net.zepalesque.redux.data.resource.registries.ReduxPlacements;

public class Blight {


public static Biome generate(BootstrapContext<Biome> context) {
HolderGetter<PlacedFeature> placed = context.lookup(Registries.PLACED_FEATURE);
HolderGetter<ConfiguredWorldCarver<?>> carvers = context.lookup(Registries.CONFIGURED_CARVER);
return new Biome.BiomeBuilder()
.hasPrecipitation(false)
.temperature(0.8F)
.downfall(0.0F)
.specialEffects(
new BiomeSpecialEffects.Builder()
.fogColor(0x93_93_bc)
.skyColor(0xc0_c0_ff)
.waterColor(0x3f_76_e4)
.waterFogColor(0x05_05_33)
.grassColorOverride(0xb1_ff_cb)
.foliageColorOverride(0xb1_ff_cb)
.grassColorModifier(BiomeSpecialEffects.GrassColorModifier.NONE)
.backgroundMusic(ReduxMusic.DEFAULT_AETHER_MUSIC)
.build())
.mobSpawnSettings(
new MobSpawnSettings.Builder()
.addMobCharge(AetherEntityTypes.COCKATRICE.get(), 0.5, 0.15)
.addMobCharge(AetherEntityTypes.ZEPHYR.get(), 0.6, 0.16)
.addMobCharge(AetherEntityTypes.AECHOR_PLANT.get(), 0.4,0.11)
.addMobCharge(AetherEntityTypes.BLUE_SWET.get(), 0.5, 0.1)
.addMobCharge(AetherEntityTypes.GOLDEN_SWET.get(), 0.5, 0.1)
.addMobCharge(AetherEntityTypes.WHIRLWIND.get(), 0.4, 0.1)
.addMobCharge(AetherEntityTypes.EVIL_WHIRLWIND.get(), 0.4, 0.1)
.addMobCharge(AetherEntityTypes.AERWHALE.get(), 0.5, 0.11)

.addSpawn(AetherMobCategory.AETHER_DARKNESS_MONSTER, new MobSpawnSettings.SpawnerData(AetherEntityTypes.COCKATRICE.get(), 8, 1, 1))
.addSpawn(AetherMobCategory.AETHER_SKY_MONSTER, new MobSpawnSettings.SpawnerData(AetherEntityTypes.ZEPHYR.get(), 20, 1, 1))
.addSpawn(AetherMobCategory.AETHER_SURFACE_MONSTER, new MobSpawnSettings.SpawnerData(AetherEntityTypes.AECHOR_PLANT.get(), 7, 1, 1))
.addSpawn(AetherMobCategory.AETHER_SURFACE_MONSTER, new MobSpawnSettings.SpawnerData(AetherEntityTypes.BLUE_SWET.get(), 6, 1, 1))
.addSpawn(AetherMobCategory.AETHER_SURFACE_MONSTER, new MobSpawnSettings.SpawnerData(AetherEntityTypes.GOLDEN_SWET.get(), 6, 1, 1))
.addSpawn(AetherMobCategory.AETHER_SURFACE_MONSTER, new MobSpawnSettings.SpawnerData(AetherEntityTypes.WHIRLWIND.get(), 3, 1, 1))
.addSpawn(AetherMobCategory.AETHER_SURFACE_MONSTER, new MobSpawnSettings.SpawnerData(AetherEntityTypes.EVIL_WHIRLWIND.get(), 1, 1, 1))
.addSpawn(AetherMobCategory.AETHER_AERWHALE, new MobSpawnSettings.SpawnerData(AetherEntityTypes.AERWHALE.get(), 10, 1, 1))

.creatureGenerationProbability(0.25F)
.addSpawn(MobCategory.CREATURE, new MobSpawnSettings.SpawnerData(AetherEntityTypes.PHYG.get(), 10, 3, 4))
.addSpawn(MobCategory.CREATURE, new MobSpawnSettings.SpawnerData(AetherEntityTypes.SHEEPUFF.get(), 12, 3, 4))
.addSpawn(MobCategory.CREATURE, new MobSpawnSettings.SpawnerData(AetherEntityTypes.FLYING_COW.get(), 12, 2, 5))
.addSpawn(MobCategory.CREATURE, new MobSpawnSettings.SpawnerData(AetherEntityTypes.AERBUNNY.get(), 11, 3, 3))
.addSpawn(MobCategory.CREATURE, new MobSpawnSettings.SpawnerData(AetherEntityTypes.MOA.get(), 8, 1, 3))
.build())
.generationSettings(
new BiomeGenerationSettings.Builder(placed, carvers)

.addFeature(GenerationStep.Decoration.RAW_GENERATION, AetherPlacedFeatures.QUICKSOIL_SHELF_PLACEMENT)

.addFeature(GenerationStep.Decoration.LAKES, ReduxPlacements.SURFACE_RULE_WATER_LAKE)

.addFeature(GenerationStep.Decoration.UNDERGROUND_ORES, AetherPlacedFeatures.ORE_AETHER_DIRT_PLACEMENT)
.addFeature(GenerationStep.Decoration.UNDERGROUND_ORES, AetherPlacedFeatures.ORE_ICESTONE_PLACEMENT)
.addFeature(GenerationStep.Decoration.UNDERGROUND_ORES, AetherPlacedFeatures.ORE_AMBROSIUM_PLACEMENT)
.addFeature(GenerationStep.Decoration.UNDERGROUND_ORES, AetherPlacedFeatures.ORE_ZANITE_PLACEMENT)
.addFeature(GenerationStep.Decoration.UNDERGROUND_ORES, AetherPlacedFeatures.ORE_GRAVITITE_BURIED_PLACEMENT)
.addFeature(GenerationStep.Decoration.UNDERGROUND_ORES, AetherPlacedFeatures.ORE_GRAVITITE_PLACEMENT)

.addFeature(GenerationStep.Decoration.FLUID_SPRINGS, AetherPlacedFeatures.WATER_SPRING_PLACEMENT)

.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, AetherPlacedFeatures.SKYROOT_FOREST_TREES_PLACEMENT)
.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, AetherPlacedFeatures.HOLIDAY_TREE_PLACEMENT)
.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, AetherPlacedFeatures.GRASS_PATCH_PLACEMENT)
.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, AetherPlacedFeatures.TALL_GRASS_PATCH_PLACEMENT)
.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, AetherPlacedFeatures.WHITE_FLOWER_PATCH_PLACEMENT)
.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, AetherPlacedFeatures.PURPLE_FLOWER_PATCH_PLACEMENT)
.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, AetherPlacedFeatures.BERRY_BUSH_PATCH_PLACEMENT)

.addFeature(GenerationStep.Decoration.TOP_LAYER_MODIFICATION, AetherPlacedFeatures.CRYSTAL_ISLAND_PLACEMENT)
.addFeature(GenerationStep.Decoration.TOP_LAYER_MODIFICATION, AetherPlacedFeatures.COLD_AERCLOUD_PLACEMENT)
.addFeature(GenerationStep.Decoration.TOP_LAYER_MODIFICATION, AetherPlacedFeatures.BLUE_AERCLOUD_PLACEMENT)
.addFeature(GenerationStep.Decoration.TOP_LAYER_MODIFICATION, AetherPlacedFeatures.GOLDEN_AERCLOUD_PLACEMENT)

.build())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ public static void bootstrap(BootstrapContext<BiomeModifier> context) {
Optional.of(new SkiesModifier.DefaultSkySettings(biomes.getOrThrow(ReduxTags.Biomes.MODIFY_SKY_COLOR), Optional.of(0x9FA4DD), Optional.of(0xBEC4E5))),
ImmutableMap.<Holder<Biome>, Integer>builder() // sky
.put(biomes.getOrThrow(ReduxBiomes.GILDED_GROVES), 0xC4BDAA)
.put(biomes.getOrThrow(ReduxBiomes.THE_BLIGHT), 0x8F90BA)
.build(),
ImmutableMap.<Holder<Biome>, Integer>builder() // fog
.put(biomes.getOrThrow(ReduxBiomes.GILDED_GROVES), 0xDDD9DA)
.put(biomes.getOrThrow(ReduxBiomes.THE_BLIGHT), 0xBCBDE2)
.build());
context.register(SKY_COLOR_AETHER, new ConditionalBiomeModifier(Holder.direct(sky), conditions.get(ReduxConditions.SKY_COLORS).orElseThrow()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.level.biome.Biome;
import net.zepalesque.redux.Redux;
import net.zepalesque.redux.data.resource.builders.biome.Blight;
import net.zepalesque.redux.data.resource.builders.biome.GildedGroves;

public class ReduxBiomes {
Expand All @@ -28,5 +29,6 @@ private static ResourceKey<Biome> createKey(String name) {

public static void bootstrap(BootstrapContext<Biome> context) {
context.register(GILDED_GROVES, GildedGroves.generate(context));
context.register(THE_BLIGHT, Blight.generate(context));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void addBiomes(Registry<Biome> registry, Consumer<Pair<Climate.ParameterP
// ResourceKey<Biome> frosted = ReduxConfig.COMMON.enable_snowy_biomes.get() ? ReduxBiomes.FROSTED_FORESTS : AetherBiomes.SKYROOT_FOREST;
// ResourceKey<Biome> glaical = ReduxConfig.COMMON.enable_snowy_biomes.get() ? ReduxBiomes.GLACIAL_TUNDRA : AetherBiomes.SKYROOT_FOREST;
// ResourceKey<Biome> cloudcaps = ReduxConfig.COMMON.enable_cloudcaps.get() ? ReduxBiomes.CLOUDCAPS : AetherBiomes.SKYROOT_GROVE;
// ResourceKey<Biome> blight = ReduxConfig.COMMON.enable_the_blight.get() ? ReduxBiomes.THE_BLIGHT : AetherBiomes.SKYROOT_WOODLAND;
ResourceKey<Biome> blight = /*ReduxConfig.COMMON.enable_the_blight.get() ?*/ ReduxBiomes.THE_BLIGHT /*: AetherBiomes.SKYROOT_WOODLAND*/;
// ResourceKey<Biome> highfields = ReduxConfig.COMMON.enable_skyfields.get() ? ReduxBiomes.SKYFIELDS : AetherBiomes.SKYROOT_MEADOW;
// ResourceKey<Biome> shrublands = ReduxConfig.COMMON.enable_skyroot_shrublands.get() ? ReduxBiomes.SKYROOT_SHRUBLANDS : AetherBiomes.SKYROOT_MEADOW;
ResourceKey<Biome> grove = /*ReduxConfig.COMMON.enable_gilded_biomes.get() ?*/ ReduxBiomes.GILDED_GROVES /*: AetherBiomes.SKYROOT_GROVE*/;
Expand All @@ -45,9 +45,9 @@ public void addBiomes(Registry<Biome> registry, Consumer<Pair<Climate.ParameterP
addBiome(mapper, new Climate.ParameterPoint(temp1, Climate.Parameter.span(0.3F, 1.0F), fullRange, fullRange, fullRange, fullRange, 0),
cloudcaps);*/

/* addBiome(mapper, new Climate.ParameterPoint(temp2, Climate.Parameter.span(-1.0F, -0.3F), fullRange, fullRange, fullRange, fullRange, 0),
blight);*/
addBiome(mapper, new Climate.ParameterPoint(temp2, Climate.Parameter.span(-0.3F, -0.15F), fullRange, fullRange, fullRange, fullRange, 0),
addBiome(mapper, new Climate.ParameterPoint(temp2, Climate.Parameter.span(-1.0F, -0.4F), fullRange, fullRange, fullRange, fullRange, 0),
blight);
addBiome(mapper, new Climate.ParameterPoint(temp2, Climate.Parameter.span(-0.4F, -0.15F), fullRange, fullRange, fullRange, fullRange, 0),
AetherBiomes.SKYROOT_FOREST);
addBiome(mapper, new Climate.ParameterPoint(temp2, Climate.Parameter.span(-0.15F, 0.0F), fullRange, fullRange, fullRange, fullRange, 0),
AetherBiomes.SKYROOT_MEADOW);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.zepalesque.redux.world.biome;

import com.aetherteam.aether.block.AetherBlockStateProperties;
import com.aetherteam.aether.block.AetherBlocks;
import com.aetherteam.aether.data.resources.registries.AetherDimensions;
import net.minecraft.core.Registry;
Expand All @@ -10,12 +11,16 @@
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.dimension.LevelStem;
import net.minecraft.world.level.levelgen.NoiseBasedChunkGenerator;
import net.minecraft.world.level.levelgen.Noises;
import net.minecraft.world.level.levelgen.SurfaceRules;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.common.EventBusSubscriber;
import net.neoforged.neoforge.event.server.ServerAboutToStartEvent;
import net.zepalesque.redux.Redux;
import net.zepalesque.redux.data.resource.registries.ReduxBiomes;
import net.zepalesque.unity.block.UnityBlocks;
import net.zepalesque.unity.data.prov.UnityBlockStateProvider;
import net.zepalesque.unity.data.resource.builders.UnityFeatureBuilders;
import net.zepalesque.zenith.api.world.density.PerlinNoiseFunction;

@EventBusSubscriber(modid = Redux.MODID, bus = EventBusSubscriber.Bus.GAME)
Expand All @@ -38,7 +43,15 @@ public static void onServerAboutToStart(ServerAboutToStartEvent event) {

public static SurfaceRules.RuleSource makeRules(/*SurfaceRules.SequenceRuleSource base*/) {
return SurfaceRules.sequence(
SurfaceRules.ifTrue(SurfaceRules.isBiome(ReduxBiomes.GILDED_GROVES), SurfaceRules.ifTrue(SurfaceRules.ON_FLOOR, SurfaceRules.state((AetherBlocks.ENCHANTED_AETHER_GRASS_BLOCK.get().defaultBlockState()))))
SurfaceRules.ifTrue(SurfaceRules.isBiome(ReduxBiomes.GILDED_GROVES),
SurfaceRules.ifTrue(SurfaceRules.ON_FLOOR,
SurfaceRules.state(
AetherBlocks.ENCHANTED_AETHER_GRASS_BLOCK.get().defaultBlockState()
))),
SurfaceRules.ifTrue(SurfaceRules.isBiome(ReduxBiomes.THE_BLIGHT),
SurfaceRules.ifTrue(SurfaceRules.ON_FLOOR,
SurfaceRules.ifTrue(SurfaceRules.noiseCondition(Noises.SWAMP, 0.4),
SurfaceRules.state(UnityFeatureBuilders.drops(UnityBlocks.COARSE_AETHER_DIRT)))))
);
}
}

0 comments on commit 602db24

Please sign in to comment.