Skip to content

Commit

Permalink
Added crafting recipes for Mossy Black Sand, Algal End Stone, Unmappe…
Browse files Browse the repository at this point in the history
…d End Stone, and Null End Stone, allowed Null Blocks to be bonemealed to grow Null Plants, removed Enderman spawns from the End Wilds, fixed Dripstone generation in the Fungal Jungle
  • Loading branch information
Forstride committed Jan 20, 2024
1 parent 691eb10 commit f5b831a
Show file tree
Hide file tree
Showing 20 changed files with 361 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.4 2024-01-19T16:16:09.6769431 Registries
// 1.20.4 2024-01-20T16:14:11.8687027 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 @@ -15,7 +15,7 @@ d0c0bdd9fc7b09e7d046e35faea8cc6d752b468a data/biomesoplenty/worldgen/biome/crag.
d4a9226ceaef3cf4eed45892e027c1eabf9fcd72 data/biomesoplenty/worldgen/biome/dune_beach.json
e289a828bcaa9b7da333c3a5c968d7294e1f3f1e data/biomesoplenty/worldgen/biome/end_corruption.json
b3eae91d1d02cfda03e70a555aaaa1bc7028bd61 data/biomesoplenty/worldgen/biome/end_reef.json
a12e588a00e94a7f9c22ae9965a8d2f13bcfe069 data/biomesoplenty/worldgen/biome/end_wilds.json
3a72fd6fdefdedcc67c90d5a8b06fc647086fc83 data/biomesoplenty/worldgen/biome/end_wilds.json
a89d541384f1a879bb82d9c984d98c512474d27c data/biomesoplenty/worldgen/biome/erupting_inferno.json
d662a9e04a7840345595d343cc34426393c04699 data/biomesoplenty/worldgen/biome/field.json
0ca60f25f9961787ec5f174f8be6f29463c4decc data/biomesoplenty/worldgen/biome/fir_clearing.json
Expand Down Expand Up @@ -220,6 +220,7 @@ d0604daa873d67e12bd3f0ce62d7994671c5b124 data/biomesoplenty/worldgen/configured_
2b93c838ff048ba3aa64c57c9beab7b299e41789 data/biomesoplenty/worldgen/configured_feature/nether_bone_spine.json
8983f10fea2f2b9edbab92a2c9c0332f32fccc3c data/biomesoplenty/worldgen/configured_feature/nether_bramble.json
f9a397d007b98bf36c83d256856fd0fcc45d3a37 data/biomesoplenty/worldgen/configured_feature/nether_vines.json
d33e52a263ddcb052ea61f4d4e52b2dab954c646 data/biomesoplenty/worldgen/configured_feature/null_plant_bonemeal.json
4a686687dedeb0b53d09db28c9f0a75e5ea2097f data/biomesoplenty/worldgen/configured_feature/null_tree.json
6141c480c606ffa99a495c76b5a9b59ffebfb789 data/biomesoplenty/worldgen/configured_feature/oak_bush.json
6227de33c6e00775d2282294f22bfe801c230003 data/biomesoplenty/worldgen/configured_feature/obsidian_splatter.json
Expand Down Expand Up @@ -498,6 +499,7 @@ eaafc116edf17b5a3c48e7bdc68f62ba84fd2deb data/biomesoplenty/worldgen/placed_feat
97840a5e6998b7403cf670f9700321ce266c1319 data/biomesoplenty/worldgen/placed_feature/nether_bone_spine.json
a0515b53a5b94f2ed1d7dbd87db0585612d83dda data/biomesoplenty/worldgen/placed_feature/nether_bramble.json
1a38b33f693e7e19b9e5975269ae2ab5cf1c2472 data/biomesoplenty/worldgen/placed_feature/nether_vines.json
e1d48766e433f22d244d373b278450616c76fe32 data/biomesoplenty/worldgen/placed_feature/null_plant_bonemeal.json
a3d701df3a8d022e81b0abe17a6f635938ae0d19 data/biomesoplenty/worldgen/placed_feature/null_tree.json
062fefe110d24798d1df521817e98394fe648a62 data/biomesoplenty/worldgen/placed_feature/oak_bush.json
2669995131b210204c99f3f718cae309ba9e822f data/biomesoplenty/worldgen/placed_feature/obsidian_splatter.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,7 @@
"axolotls": [],
"creature": [],
"misc": [],
"monster": [
{
"type": "minecraft:enderman",
"maxCount": 4,
"minCount": 4,
"weight": 10
}
],
"monster": [],
"underground_water_creature": [],
"water_ambient": [],
"water_creature": []
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"type": "minecraft:simple_block",
"config": {
"to_place": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "biomesoplenty:null_plant"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"feature": "biomesoplenty:null_plant_bonemeal",
"placement": [
{
"type": "minecraft:block_predicate_filter",
"predicate": {
"type": "minecraft:matching_blocks",
"blocks": "minecraft:air"
}
}
]
}
2 changes: 0 additions & 2 deletions common/src/main/java/biomesoplenty/biome/BOPEndBiomes.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import biomesoplenty.worldgen.placement.BOPEndPlacements;
import biomesoplenty.worldgen.placement.BOPVegetationPlacements;
import net.minecraft.core.HolderGetter;
import net.minecraft.data.worldgen.BiomeDefaultFeatures;
import net.minecraft.data.worldgen.placement.EndPlacements;
import net.minecraft.world.level.biome.*;
import net.minecraft.world.level.levelgen.GenerationStep;
Expand All @@ -20,7 +19,6 @@ public class BOPEndBiomes
public static Biome endWilds(HolderGetter<PlacedFeature> placedFeatureGetter, HolderGetter<ConfiguredWorldCarver<?>> carverGetter)
{
MobSpawnSettings.Builder mobSpawnBuilder = new MobSpawnSettings.Builder();
BiomeDefaultFeatures.endSpawns(mobSpawnBuilder);
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.TREES_END_WILDS);
Expand Down
56 changes: 55 additions & 1 deletion common/src/main/java/biomesoplenty/block/NullBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,23 @@
package biomesoplenty.block;

import biomesoplenty.init.ModParticles;
import biomesoplenty.worldgen.placement.BOPEndPlacements;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Holder;
import net.minecraft.core.registries.Registries;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.BonemealableBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.placement.PlacedFeature;

public class NullBlock extends Block
import java.util.Optional;

public class NullBlock extends Block implements BonemealableBlock
{
public NullBlock(Properties properties)
{
Expand Down Expand Up @@ -44,4 +53,49 @@ public void animateTick(BlockState p_221253_, Level p_221254_, BlockPos p_221255
}
}
}

@Override
public boolean isValidBonemealTarget(LevelReader p_153797_, BlockPos p_153798_, BlockState p_153799_)
{
return p_153797_.getBlockState(p_153798_.above()).isAir();
}

@Override
public boolean isBonemealSuccess(Level p_153802_, RandomSource p_153803_, BlockPos p_153804_, BlockState p_153805_)
{
return true;
}

@Override
public void performBonemeal(ServerLevel p_221270_, RandomSource p_221271_, BlockPos p_221272_, BlockState p_221273_)
{
BlockPos blockpos = p_221272_.above();
Optional<Holder.Reference<PlacedFeature>> optional = p_221270_.registryAccess().registryOrThrow(Registries.PLACED_FEATURE).getHolder(BOPEndPlacements.NULL_PLANT_BONEMEAL);

label49:
for(int i = 0; i < 128; ++i)
{
BlockPos blockpos1 = blockpos;

for(int j = 0; j < i / 16; ++j)
{
blockpos1 = blockpos1.offset(p_221271_.nextInt(3) - 1, (p_221271_.nextInt(3) - 1) * p_221271_.nextInt(3) / 2, p_221271_.nextInt(3) - 1);
if (!p_221270_.getBlockState(blockpos1.below()).is(this) || p_221270_.getBlockState(blockpos1).isCollisionShapeFullBlock(p_221270_, blockpos1)) {
continue label49;
}
}

BlockState blockstate1 = p_221270_.getBlockState(blockpos1);
if (blockstate1.isAir()) {
Holder<PlacedFeature> holder;
if (!optional.isPresent()) {
continue;
}

holder = optional.get();

holder.value().place(p_221270_, p_221270_.getChunkSource().getGenerator(), p_221271_, blockpos1);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class BOPEndFeatures
public static final ResourceKey<ConfiguredFeature<?, ?>> LIQUID_NULL_SPRING = BOPFeatureUtils.createKey("liquid_null_spring");
public static final ResourceKey<ConfiguredFeature<?, ?>> LUMALOOP = BOPFeatureUtils.createKey("lumaloop");
public static final ResourceKey<ConfiguredFeature<?, ?>> MONOLITH = BOPFeatureUtils.createKey("monolith");
public static final ResourceKey<ConfiguredFeature<?, ?>> NULL_PLANT_BONEMEAL = BOPFeatureUtils.createKey("null_plant_bonemeal");
public static final ResourceKey<ConfiguredFeature<?, ?>> PATCH_ENDERPHYTES = BOPFeatureUtils.createKey("patch_enderphytes");
public static final ResourceKey<ConfiguredFeature<?, ?>> PATCH_NULL_PLANTS = BOPFeatureUtils.createKey("patch_null_plants");
public static final ResourceKey<ConfiguredFeature<?, ?>> TIDEPOOL = BOPFeatureUtils.createKey("tidepool");
Expand All @@ -64,6 +65,7 @@ public static void bootstrap(BootstapContext<ConfiguredFeature<?, ?>> context)
register(context, BOPEndFeatures.LIQUID_NULL_SPRING, Feature.SPRING, new SpringConfiguration(BOPFluids.LIQUID_NULL.defaultFluidState(), false, 4, 1, HolderSet.direct(Block::builtInRegistryHolder, Blocks.END_STONE, BOPBlocks.NULL_END_STONE, BOPBlocks.UNMAPPED_END_STONE)));
register(context, BOPEndFeatures.LUMALOOP, BOPBaseFeatures.LUMALOOP, NoneFeatureConfiguration.INSTANCE);
register(context, BOPEndFeatures.MONOLITH, BOPBaseFeatures.MONOLITH, NoneFeatureConfiguration.INSTANCE);
register(context, BOPEndFeatures.NULL_PLANT_BONEMEAL, Feature.SIMPLE_BLOCK, new SimpleBlockConfiguration(BlockStateProvider.simple(BOPBlocks.NULL_PLANT.defaultBlockState())));
register(context, BOPEndFeatures.PATCH_ENDERPHYTES, Feature.RANDOM_PATCH, FeatureUtils.simplePatchConfiguration(Feature.SIMPLE_BLOCK, new SimpleBlockConfiguration(BlockStateProvider.simple(BOPBlocks.ENDERPHYTE))));
register(context, BOPEndFeatures.PATCH_NULL_PLANTS, Feature.RANDOM_PATCH, FeatureUtils.simplePatchConfiguration(Feature.SIMPLE_BLOCK, new SimpleBlockConfiguration(BlockStateProvider.simple(BOPBlocks.NULL_PLANT))));
register(context, BOPEndFeatures.TIDEPOOL, BOPBaseFeatures.TIDEPOOL, NoneFeatureConfiguration.INSTANCE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.LevelSimulatedReader;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.Blocks;
Expand All @@ -21,6 +21,8 @@
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;

import java.util.function.Consumer;

public class DripstoneSplatterFeature extends Feature<NoneFeatureConfiguration>
{
public DripstoneSplatterFeature(Codec<NoneFeatureConfiguration> deserializer)
Expand Down Expand Up @@ -51,19 +53,14 @@ public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featurePlaceC
{
BlockPos blockpos = new BlockPos(k, k1, l);
BlockState blockstate = worldIn.getBlockState(blockpos);
BlockState blockstate1 = worldIn.getBlockState(blockpos.above());

if (blockstate.getBlock() == Blocks.GRASS_BLOCK && this.isAir(worldIn, blockpos.above()))
{
worldIn.setBlock(blockpos, Blocks.DRIPSTONE_BLOCK.defaultBlockState(), 2);
if (rand.nextInt(5) == 0)
{
int height = 1 + rand.nextInt(8);
for (int ii = height; ii > 0; ii--)
{
BlockPos dripPos = blockpos.above(ii);
worldIn.setBlock(dripPos, Blocks.POINTED_DRIPSTONE.defaultBlockState().setValue(PointedDripstoneBlock.THICKNESS,calculateDripstoneThickness(worldIn, dripPos, Direction.UP, false)), 2);
}
growPointedDripstone(worldIn, blockpos.above(), Direction.UP, height, false);
}

++i;
Expand All @@ -77,26 +74,46 @@ public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featurePlaceC
return i > 0;
}

private static DripstoneThickness calculateDripstoneThickness(LevelReader p_154093_, BlockPos p_154094_, Direction p_154095_, boolean p_154096_) {
Direction direction = p_154095_.getOpposite();
BlockState blockstate = p_154093_.getBlockState(p_154094_.relative(p_154095_));
if (isPointedDripstoneWithDirection(blockstate, direction)) {
return !p_154096_ && blockstate.getValue(PointedDripstoneBlock.THICKNESS) != DripstoneThickness.TIP_MERGE ? DripstoneThickness.TIP : DripstoneThickness.TIP_MERGE;
} else if (!isPointedDripstoneWithDirection(blockstate, p_154095_)) {
return DripstoneThickness.TIP;
} else {
DripstoneThickness dripstonethickness = blockstate.getValue(PointedDripstoneBlock.THICKNESS);
if (dripstonethickness != DripstoneThickness.TIP && dripstonethickness != DripstoneThickness.TIP_MERGE) {
BlockState blockstate1 = p_154093_.getBlockState(p_154094_.relative(direction));
return !isPointedDripstoneWithDirection(blockstate1, p_154095_) ? DripstoneThickness.BASE : DripstoneThickness.MIDDLE;
} else {
return DripstoneThickness.FRUSTUM;
protected static void growPointedDripstone(LevelAccessor p_190848_, BlockPos p_190849_, Direction p_190850_, int p_190851_, boolean p_190852_)
{
BlockPos.MutableBlockPos blockpos$mutableblockpos = p_190849_.mutable();
buildBaseToTipColumn(p_190850_, p_190851_, p_190852_, (p_309326_) -> {
if (p_309326_.is(Blocks.POINTED_DRIPSTONE))
{
p_309326_ = p_309326_.setValue(PointedDripstoneBlock.WATERLOGGED, Boolean.valueOf(p_190848_.isWaterAt(blockpos$mutableblockpos)));
}

p_190848_.setBlock(blockpos$mutableblockpos, p_309326_, 2);
blockpos$mutableblockpos.move(p_190850_);
});
}

protected static void buildBaseToTipColumn(Direction p_159652_, int p_159653_, boolean p_159654_, Consumer<BlockState> p_159655_)
{
if (p_159653_ >= 3)
{
p_159655_.accept(createPointedDripstone(p_159652_, DripstoneThickness.BASE));

for(int i = 0; i < p_159653_ - 3; ++i)
{
p_159655_.accept(createPointedDripstone(p_159652_, DripstoneThickness.MIDDLE));
}
}

if (p_159653_ >= 2)
{
p_159655_.accept(createPointedDripstone(p_159652_, DripstoneThickness.FRUSTUM));
}

if (p_159653_ >= 1)
{
p_159655_.accept(createPointedDripstone(p_159652_, p_159654_ ? DripstoneThickness.TIP_MERGE : DripstoneThickness.TIP));
}
}

private static boolean isPointedDripstoneWithDirection(BlockState p_154208_, Direction p_154209_) {
return p_154208_.is(Blocks.POINTED_DRIPSTONE) && p_154208_.getValue(PointedDripstoneBlock.TIP_DIRECTION) == p_154209_;
private static BlockState createPointedDripstone(Direction p_159657_, DripstoneThickness p_159658_)
{
return Blocks.POINTED_DRIPSTONE.defaultBlockState().setValue(PointedDripstoneBlock.TIP_DIRECTION, p_159657_).setValue(PointedDripstoneBlock.THICKNESS, p_159658_);
}

public static boolean isAir(LevelSimulatedReader level, BlockPos pos)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class BOPEndPlacements
public static final ResourceKey<PlacedFeature> LIQUID_NULL_SPRING = BOPPlacementUtils.createKey("liquid_null_spring");
public static final ResourceKey<PlacedFeature> LUMALOOP = BOPPlacementUtils.createKey("lumaloop");
public static final ResourceKey<PlacedFeature> MONOLITH = BOPPlacementUtils.createKey("monolith");
public static final ResourceKey<PlacedFeature> NULL_PLANT_BONEMEAL = BOPPlacementUtils.createKey("null_plant_bonemeal");
public static final ResourceKey<PlacedFeature> PATCH_ENDERPHYTES = BOPPlacementUtils.createKey("patch_enderphytes");
public static final ResourceKey<PlacedFeature> PATCH_NULL_PLANTS = BOPPlacementUtils.createKey("patch_null_plants");
public static final ResourceKey<PlacedFeature> TIDEPOOL = BOPPlacementUtils.createKey("tidepool");
Expand All @@ -55,6 +56,7 @@ public static void bootstrap(BootstapContext<PlacedFeature> context)
final Holder<ConfiguredFeature<?, ?>> LIQUID_NULL_SPRING = configuredFeatureGetter.getOrThrow(BOPEndFeatures.LIQUID_NULL_SPRING);
final Holder<ConfiguredFeature<?, ?>> LUMALOOP = configuredFeatureGetter.getOrThrow(BOPEndFeatures.LUMALOOP);
final Holder<ConfiguredFeature<?, ?>> MONOLITH = configuredFeatureGetter.getOrThrow(BOPEndFeatures.MONOLITH);
final Holder<ConfiguredFeature<?, ?>> NULL_PLANT_BONEMEAL = configuredFeatureGetter.getOrThrow(BOPEndFeatures.NULL_PLANT_BONEMEAL);
final Holder<ConfiguredFeature<?, ?>> PATCH_ENDERPHYTES = configuredFeatureGetter.getOrThrow(BOPEndFeatures.PATCH_ENDERPHYTES);
final Holder<ConfiguredFeature<?, ?>> PATCH_NULL_PLANTS = configuredFeatureGetter.getOrThrow(BOPEndFeatures.PATCH_NULL_PLANTS);
final Holder<ConfiguredFeature<?, ?>> TIDEPOOL = configuredFeatureGetter.getOrThrow(BOPEndFeatures.TIDEPOOL);
Expand All @@ -73,6 +75,7 @@ public static void bootstrap(BootstapContext<PlacedFeature> context)
register(context, BOPEndPlacements.LIQUID_NULL_SPRING, LIQUID_NULL_SPRING, List.of(CountPlacement.of(10), InSquarePlacement.spread(), PlacementUtils.FULL_RANGE, BiomeFilter.biome()));
register(context, BOPEndPlacements.LUMALOOP, LUMALOOP, List.of(RarityFilter.onAverageOnceEvery(1), InSquarePlacement.spread(), PlacementUtils.HEIGHTMAP, BiomeFilter.biome()));
register(context, BOPEndPlacements.MONOLITH, MONOLITH, List.of(RarityFilter.onAverageOnceEvery(4), InSquarePlacement.spread(), PlacementUtils.HEIGHTMAP, BiomeFilter.biome()));
register(context, BOPEndPlacements.NULL_PLANT_BONEMEAL, NULL_PLANT_BONEMEAL, PlacementUtils.isEmpty());
register(context, BOPEndPlacements.PATCH_ENDERPHYTES, PATCH_ENDERPHYTES, VegetationPlacements.worldSurfaceSquaredWithCount(5));
register(context, BOPEndPlacements.PATCH_NULL_PLANTS, PATCH_NULL_PLANTS, List.of(RarityFilter.onAverageOnceEvery(2), InSquarePlacement.spread(), PlacementUtils.HEIGHTMAP_WORLD_SURFACE, BiomeFilter.biome()));
register(context, BOPEndPlacements.TIDEPOOL, TIDEPOOL, List.of(CountPlacement.of(3), InSquarePlacement.spread(), PlacementUtils.HEIGHTMAP_TOP_SOLID, BiomeFilter.biome()));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "biomesoplenty:block/lumaloop_lit"
"layer0": "biomesoplenty:block/lumaloop_plant"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "biomesoplenty:block/lumaloop_lit"
"layer0": "biomesoplenty:block/lumaloop_plant"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"biomesoplenty:algal_end_stone"
]
},
"criteria": {
"has_enderphyte": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": [
"biomesoplenty:enderphyte"
]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "biomesoplenty:algal_end_stone"
}
}
},
"requirements": [
[
"has_enderphyte",
"has_the_recipe"
]
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"biomesoplenty:mossy_black_sand"
]
},
"criteria": {
"has_moss_block": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": [
"minecraft:moss_block"
]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "biomesoplenty:mossy_black_sand"
}
}
},
"requirements": [
[
"has_moss_block",
"has_the_recipe"
]
]
}
Loading

0 comments on commit f5b831a

Please sign in to comment.