@@ -27,20 +27,22 @@ public class MoundGenFeature extends GenFeature {
2727 }).setCenter (new BlockPos (2 , 3 , 2 ));
2828
2929 public static final ConfigurationProperty <Integer > MOUND_CUTOFF_RADIUS = ConfigurationProperty .integer ("mound_cutoff_radius" );
30+ public static final ConfigurationProperty <Boolean > OFFSET = ConfigurationProperty .bool ("offset" );
3031
3132 public MoundGenFeature (ResourceLocation registryName ) {
3233 super (registryName );
3334 }
3435
3536 @ Override
3637 protected void registerProperties () {
37- this .register (MOUND_CUTOFF_RADIUS );
38+ this .register (MOUND_CUTOFF_RADIUS , OFFSET );
3839 }
3940
4041 @ Override
4142 protected GenFeatureConfiguration createDefaultConfiguration () {
4243 return super .createDefaultConfiguration ()
43- .with (MOUND_CUTOFF_RADIUS , 5 );
44+ .with (MOUND_CUTOFF_RADIUS , 5 )
45+ .with (OFFSET , true );
4446 }
4547
4648 /**
@@ -60,17 +62,9 @@ protected BlockPos preGenerate(GenFeatureConfiguration configuration, PreGenerat
6062 BlockState initialDirtState = level .getBlockState (rootPos );
6163 BlockState initialUnderState = level .getBlockState (rootPos .below ());
6264
63- // if (initialUnderState.isAir() || (!initialUnderState.is(BlockTags.DIRT) && !initialUnderState.is(Tags.Blocks.STONE))) {
64- // final Biome biome = level.getUncachedNoiseBiome(
65- // rootPos.getX() >> 2,
66- // rootPos.getY() >> 2,
67- // rootPos.getZ() >> 2
68- // ).value();
69- // //todo: figure out if needs replacement
70- // // initialUnderState = biome.getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
71- // }
72-
73- rootPos = rootPos .above ();
65+ if (configuration .get (OFFSET )){
66+ rootPos = rootPos .above ();
67+ }
7468
7569 for (Cell cell : moundMap .getAllNonZeroCells ()) {
7670 final BlockState placeState = cell .getValue () == 1 ? initialDirtState : initialUnderState ;
0 commit comments