Skip to content

Commit

Permalink
Started on Dead Coral generation, improvements to Anomaly generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Forstride committed Jan 14, 2024
1 parent 4bb6d78 commit 3fd887e
Show file tree
Hide file tree
Showing 20 changed files with 511 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.4 2024-01-14T02:13:56.8026759 Registries
// 1.20.4 2024-01-14T10:15:31.5981195 Registries
bec08031dc5126119d3c7a1033703f8235bdf56e data/biomesoplenty/damage_type/bramble.json
41f8df67f585538edc9847b6754275d24b813e06 data/biomesoplenty/damage_type/fumarole.json
1db19ce8d33b8c131955b60ed830200bbee6a912 data/biomesoplenty/worldgen/biome/aspen_glade.json
Expand All @@ -16,7 +16,7 @@ d4a9226ceaef3cf4eed45892e027c1eabf9fcd72 data/biomesoplenty/worldgen/biome/dune_
253f26c8caa759d436ace9d8d5fe7ddc55ee4f8c data/biomesoplenty/worldgen/biome/end_aeries.json
1d2989a8aed931ff5de5fabff53cd9014d8f0c21 data/biomesoplenty/worldgen/biome/end_corruption.json
253f26c8caa759d436ace9d8d5fe7ddc55ee4f8c data/biomesoplenty/worldgen/biome/end_drifts.json
253f26c8caa759d436ace9d8d5fe7ddc55ee4f8c data/biomesoplenty/worldgen/biome/end_reef.json
32b9b82ab839f70df725c3aceaf2ea2a0bb2cbd3 data/biomesoplenty/worldgen/biome/end_reef.json
01773716ee0f40a49bb0f57b9abd91d5195f0be2 data/biomesoplenty/worldgen/biome/end_wilds.json
a89d541384f1a879bb82d9c984d98c512474d27c data/biomesoplenty/worldgen/biome/erupting_inferno.json
d662a9e04a7840345595d343cc34426393c04699 data/biomesoplenty/worldgen/biome/field.json
Expand Down Expand Up @@ -78,6 +78,7 @@ a4d5101a19a38da4f42164b672b74766edb26bc9 data/biomesoplenty/worldgen/configured_
d5b35b4d78f4ece7de470e07042aa6b0d37b967f data/biomesoplenty/worldgen/configured_feature/acacia_twiglet_small.json
5ad22ddf8febfef57979f7bed8ab4afe22358ee9 data/biomesoplenty/worldgen/configured_feature/anomaly.json
0a655897c67fb080ad5a16402720bfbec87cf3e7 data/biomesoplenty/worldgen/configured_feature/aspen_tree.json
3cf80e67a2afd31591c0c30781dc8193105ec316 data/biomesoplenty/worldgen/configured_feature/barnacles.json
14386c8cb811e1cd0d768ba7fe5b06642e0471c7 data/biomesoplenty/worldgen/configured_feature/big_dripleaf.json
9e764721494e61fc108e60fa5e2b3c44158b736f data/biomesoplenty/worldgen/configured_feature/big_flowering_oak_tree.json
76d786439348db02c59279d595db7e28459d07d1 data/biomesoplenty/worldgen/configured_feature/big_flowering_oak_tree_bees.json
Expand Down Expand Up @@ -109,6 +110,7 @@ d208d291658b2a5cabee58b8efffdfbbce41aee8 data/biomesoplenty/worldgen/configured_
64932fa65018e2be7acff61093a904d583277b44 data/biomesoplenty/worldgen/configured_feature/cypress_tree.json
0f79e15b55bf3b5be1523ed3e85ea4fa26a796d0 data/biomesoplenty/worldgen/configured_feature/cypress_tree_medium.json
1c568da7ae87f6695078ede1bef42f1488501f5e data/biomesoplenty/worldgen/configured_feature/dark_oak_poplar_tree.json
732e6858936bf354d3274e1c4b4e5217a5ccaba0 data/biomesoplenty/worldgen/configured_feature/dead_coral.json
cd2b9f82f108fe30dd3a4a878bd7216a37c98091 data/biomesoplenty/worldgen/configured_feature/dead_grass.json
08290748a4feb659eabc32c099b036ba04f3d930 data/biomesoplenty/worldgen/configured_feature/dead_tree_wasteland.json
599fe99edb01b6d56389ca55908717765a1ea2cb data/biomesoplenty/worldgen/configured_feature/dead_twiglet_tree.json
Expand Down Expand Up @@ -345,6 +347,7 @@ c548e3e1710931daabe90c90b6b7ad46c66bedda data/biomesoplenty/worldgen/configured_
5b240cfa80edf39078866602b63410068a2dae30 data/biomesoplenty/worldgen/placed_feature/acacia_twiglet_small.json
0381b44f5e62e5796b4a89805d3c337730562c51 data/biomesoplenty/worldgen/placed_feature/anomaly.json
176edb4fcaa5785050c8543834fc6c30848fe124 data/biomesoplenty/worldgen/placed_feature/aspen_tree.json
262fcb297eaf8332542e67df044ed67d3c6f9211 data/biomesoplenty/worldgen/placed_feature/barnacles.json
7395a3d04e360d03dc998ebc9cf6b8d66e41433d data/biomesoplenty/worldgen/placed_feature/big_dripleaf.json
ea928d87f641694fd67f7dd56ffb25f2cf02d033 data/biomesoplenty/worldgen/placed_feature/big_flowering_tree.json
0e5d77a2ea27daea073139ed83382706b1562332 data/biomesoplenty/worldgen/placed_feature/big_hellbark_tree.json
Expand Down Expand Up @@ -372,6 +375,7 @@ ea74748c10a9cb9224fc0be2822956acc94867a1 data/biomesoplenty/worldgen/placed_feat
5c6e712bb74bc268bb6659e0f73e7797fdb2d353 data/biomesoplenty/worldgen/placed_feature/cypress_tree.json
195481b0426113a9bcaf519cc9064cbebf8507b4 data/biomesoplenty/worldgen/placed_feature/cypress_tree_medium.json
4143fbe4921960b7c766593a0c0fb4bef8c2e88a data/biomesoplenty/worldgen/placed_feature/dark_oak_poplar_tree.json
bd6c74a95487b39da5b3d9ff003d485685b547c9 data/biomesoplenty/worldgen/placed_feature/dead_coral.json
491adc1fc84802b69d5bb5800507d773cb23e54b data/biomesoplenty/worldgen/placed_feature/dead_grass_45.json
cec9215a5d9f08511ddbddd59bec252ce4c4d204 data/biomesoplenty/worldgen/placed_feature/dead_tree_wasteland.json
57486a3dd4ba0cb77a463c588a2af146eb586b40 data/biomesoplenty/worldgen/placed_feature/dead_twiglet_tree.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
[],
[
"minecraft:end_gateway_return"
],
[],
[],
[],
[],
[
"biomesoplenty:dead_coral",
"biomesoplenty:barnacles"
]
],
"has_precipitation": false,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "biomesoplenty:barnacles",
"config": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"type": "minecraft:simple_random_selector",
"config": {
"features": [
{
"feature": {
"type": "biomesoplenty:dead_coral_tree",
"config": {}
},
"placement": []
},
{
"feature": {
"type": "biomesoplenty:dead_coral_claw",
"config": {}
},
"placement": []
},
{
"feature": {
"type": "biomesoplenty:dead_coral_mushroom",
"config": {}
},
"placement": []
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"feature": "biomesoplenty:barnacles",
"placement": [
{
"type": "minecraft:count",
"count": 4
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "MOTION_BLOCKING"
},
{
"type": "minecraft:biome"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"feature": "biomesoplenty:dead_coral",
"placement": [
{
"type": "minecraft:noise_based_count",
"noise_factor": 400.0,
"noise_offset": 0.0,
"noise_to_count_ratio": 20
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "OCEAN_FLOOR_WG"
},
{
"type": "minecraft:biome"
}
]
}
2 changes: 2 additions & 0 deletions common/src/main/java/biomesoplenty/biome/BOPEndBiomes.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public static Biome endReef(HolderGetter<PlacedFeature> placedFeatureGetter, Hol
{
BiomeGenerationSettings.Builder biomeBuilder = new BiomeGenerationSettings.Builder(placedFeatureGetter, carverGetter);
biomeBuilder.addFeature(GenerationStep.Decoration.SURFACE_STRUCTURES, EndPlacements.END_GATEWAY_RETURN);
biomeBuilder.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, BOPEndPlacements.DEAD_CORAL);
biomeBuilder.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, BOPEndPlacements.BARNACLES);
return baseEndBiome(biomeBuilder);
}

Expand Down
4 changes: 4 additions & 0 deletions common/src/main/java/biomesoplenty/init/ModTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ private static void setup() {}

public static final TagKey<Block> BLACKSTONE_DECORATION_PLACEABLE = create(new ResourceLocation(BiomesOPlenty.MOD_ID, "blackstone_decoration_placeable"));
public static final TagKey<Block> BRIMSTONE_DECORATION_PLACEABLE = create(new ResourceLocation(BiomesOPlenty.MOD_ID, "brimstone_decoration_placeable"));
public static final TagKey<Block> DEAD_CORALS = create(new ResourceLocation(BiomesOPlenty.MOD_ID, "dead_corals"));
public static final TagKey<Block> DEAD_CORAL_BLOCKS = create(new ResourceLocation(BiomesOPlenty.MOD_ID, "dead_coral_blocks"));
public static final TagKey<Block> DEAD_CORAL_PLANTS = create(new ResourceLocation(BiomesOPlenty.MOD_ID, "dead_coral_plants"));
public static final TagKey<Block> DEAD_WALL_CORALS = create(new ResourceLocation(BiomesOPlenty.MOD_ID, "dead_wall_corals"));
public static final TagKey<Block> FLESH = create(new ResourceLocation(BiomesOPlenty.MOD_ID, "flesh"));
public static final TagKey<Block> FLESH_DECORATION_PLACEABLE = create(new ResourceLocation(BiomesOPlenty.MOD_ID, "flesh_decoration_placeable"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ public class BOPBaseFeatures
public static BOPTreeFeature<TaigaTreeConfiguration> UMBRAN_TREE;
public static Feature<NoneFeatureConfiguration> WEBBING;
public static Feature<NoneFeatureConfiguration> ORIGIN_GRAVEL_CLIFFS;

public static Feature<NoneFeatureConfiguration> DEAD_CORAL_TREE;
public static Feature<NoneFeatureConfiguration> DEAD_CORAL_MUSHROOM;
public static Feature<NoneFeatureConfiguration> DEAD_CORAL_CLAW;
public static Feature<NoneFeatureConfiguration> BARNACLES;

public static void registerFeatures(BiConsumer<ResourceLocation, Feature<?>> func)
{
Expand Down Expand Up @@ -159,6 +162,10 @@ public static void registerFeatures(BiConsumer<ResourceLocation, Feature<?>> fun
UMBRAN_TREE = register(func, "umbran_tree", new UmbranTreeFeature(TaigaTreeConfiguration.CODEC));
WEBBING = register(func, "webbing", new WebbingFeature(NoneFeatureConfiguration.CODEC));
ORIGIN_GRAVEL_CLIFFS = register(func, "origin_gravel_cliffs", new OriginGravelCliffFeature(NoneFeatureConfiguration.CODEC));
DEAD_CORAL_TREE = register(func, "dead_coral_tree", new DeadCoralTreeFeature(NoneFeatureConfiguration.CODEC));
DEAD_CORAL_MUSHROOM = register(func, "dead_coral_mushroom", new DeadCoralMushroomFeature(NoneFeatureConfiguration.CODEC));
DEAD_CORAL_CLAW = register(func, "dead_coral_claw", new DeadCoralClawFeature(NoneFeatureConfiguration.CODEC));
BARNACLES = register(func, "barnacles", new BarnacleFeature(NoneFeatureConfiguration.CODEC));
}

private static <C extends FeatureConfiguration, F extends Feature<C>> F register(BiConsumer<ResourceLocation, Feature<?>> func, String name, F feature)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,25 @@
import com.google.common.collect.ImmutableList;
import net.minecraft.core.Holder;
import net.minecraft.core.HolderGetter;
import net.minecraft.core.HolderSet;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.BootstapContext;
import net.minecraft.data.worldgen.features.FeatureUtils;
import net.minecraft.data.worldgen.placement.PlacementUtils;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.world.level.levelgen.feature.LakeFeature;
import net.minecraft.world.level.levelgen.feature.WeightedPlacedFeature;
import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.levelgen.feature.configurations.RandomFeatureConfiguration;
import net.minecraft.world.level.levelgen.feature.configurations.SimpleBlockConfiguration;
import net.minecraft.world.level.levelgen.feature.configurations.*;
import net.minecraft.world.level.levelgen.feature.stateproviders.BlockStateProvider;
import net.minecraft.world.level.levelgen.placement.PlacedFeature;

public class BOPEndFeatures
{
public static final ResourceKey<ConfiguredFeature<?, ?>> ANOMALY = BOPFeatureUtils.createKey("anomaly");
public static final ResourceKey<ConfiguredFeature<?, ?>> BARNACLES = BOPFeatureUtils.createKey("barnacles");
public static final ResourceKey<ConfiguredFeature<?, ?>> DEAD_CORAL = BOPFeatureUtils.createKey("dead_coral");
public static final ResourceKey<ConfiguredFeature<?, ?>> ENDERPHYTE_BONEMEAL = BOPFeatureUtils.createKey("enderphyte_bonemeal");
public static final ResourceKey<ConfiguredFeature<?, ?>> FLOWER_END_WILDS = BOPFeatureUtils.createKey("flower_end_wilds");
public static final ResourceKey<ConfiguredFeature<?, ?>> NULL_LAKE = BOPFeatureUtils.createKey("null_lake");
Expand All @@ -40,6 +41,8 @@ public static void bootstrap(BootstapContext<ConfiguredFeature<?, ?>> context)
final Holder<PlacedFeature> NULL_TREE_CHECKED = placedFeatureGetter.getOrThrow(BOPTreePlacements.NULL_TREE_CHECKED);

register(context, BOPEndFeatures.ANOMALY, BOPBaseFeatures.ANOMALY, NoneFeatureConfiguration.INSTANCE);
register(context, BOPEndFeatures.BARNACLES, BOPBaseFeatures.BARNACLES, NoneFeatureConfiguration.INSTANCE);
register(context, BOPEndFeatures.DEAD_CORAL, Feature.SIMPLE_RANDOM_SELECTOR, new SimpleRandomFeatureConfiguration(HolderSet.direct(PlacementUtils.inlinePlaced(BOPBaseFeatures.DEAD_CORAL_TREE, FeatureConfiguration.NONE), PlacementUtils.inlinePlaced(BOPBaseFeatures.DEAD_CORAL_CLAW, FeatureConfiguration.NONE), PlacementUtils.inlinePlaced(BOPBaseFeatures.DEAD_CORAL_MUSHROOM, FeatureConfiguration.NONE))));
register(context, BOPEndFeatures.ENDERPHYTE_BONEMEAL, Feature.SIMPLE_BLOCK, new SimpleBlockConfiguration(BlockStateProvider.simple(BOPBlocks.ENDERPHYTE.defaultBlockState())));
register(context, BOPEndFeatures.FLOWER_END_WILDS, Feature.FLOWER, FeatureUtils.simplePatchConfiguration(Feature.SIMPLE_BLOCK, new SimpleBlockConfiguration(BlockStateProvider.simple(BOPBlocks.ALGAE_BLOOM))));
register(context, BOPEndFeatures.NULL_LAKE, Feature.LAKE, new LakeFeature.Configuration(BlockStateProvider.simple(BOPBlocks.NULL_BLOCK), BlockStateProvider.simple(BOPBlocks.NULL_END_STONE)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featurePlaceC
return false;
}

int size = rand.nextInt(5);
int anomalyHeight = size+4;
int size = rand.nextInt(3) + 2;
int anomalyHeight = size+3;

if (!this.checkSpace(world, startPos, size, anomalyHeight))
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*******************************************************************************
* Copyright 2022, the Glitchfiend Team.
* All rights reserved.
******************************************************************************/
package biomesoplenty.worldgen.feature.misc;

import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.init.ModTags;
import com.mojang.serialization.Codec;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.MultifaceBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;

public class BarnacleFeature extends Feature<NoneFeatureConfiguration>
{
public BarnacleFeature(Codec<NoneFeatureConfiguration> deserializer)
{
super(deserializer);
}

@Override
public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featurePlaceContext)
{
WorldGenLevel worldIn = featurePlaceContext.level();
ChunkGenerator chunkGenerator = featurePlaceContext.chunkGenerator();
RandomSource rand = featurePlaceContext.random();
BlockPos pos = featurePlaceContext.origin();
NoneFeatureConfiguration config = featurePlaceContext.config();
int i = 0;
int j = rand.nextInt(8 - 2) + 2;

for (int k = pos.getX() - j; k <= pos.getX() + j; ++k)
{
for (int l = pos.getZ() - j; l <= pos.getZ() + j; ++l)
{
int i1 = k - pos.getX();
int j1 = l - pos.getZ();
if (i1 * i1 + j1 * j1 <= j * j)
{
for (int k1 = pos.getY() - j; k1 <= pos.getY() + j; ++k1)
{
BlockPos blockpos = new BlockPos(k, k1, l);
BlockState blockstate = worldIn.getBlockState(blockpos);
BlockState barnaclestate = BOPBlocks.BARNACLES.defaultBlockState();

int faces = 0;

for (Direction direction : Direction.values())
{
BlockState blockstate1 = worldIn.getBlockState(blockpos.relative(direction));
if (blockstate1 == Blocks.END_STONE.defaultBlockState() || blockstate1 == BOPBlocks.ALGAL_END_STONE.defaultBlockState() || blockstate1.is(ModTags.Blocks.DEAD_CORAL_BLOCKS))
{
barnaclestate = barnaclestate.setValue(MultifaceBlock.getFaceProperty(direction), true);
faces++;
}
}

if (blockstate.isAir() && faces > 0)
{
worldIn.setBlock(blockpos, barnaclestate, 2);

++i;
break;
}
}
}
}
}

return i > 0;
}
}
Loading

0 comments on commit 3fd887e

Please sign in to comment.