@@ -27,20 +27,22 @@ public class MoundGenFeature extends GenFeature {
27
27
}).setCenter (new BlockPos (2 , 3 , 2 ));
28
28
29
29
public static final ConfigurationProperty <Integer > MOUND_CUTOFF_RADIUS = ConfigurationProperty .integer ("mound_cutoff_radius" );
30
+ public static final ConfigurationProperty <Boolean > OFFSET = ConfigurationProperty .bool ("offset" );
30
31
31
32
public MoundGenFeature (ResourceLocation registryName ) {
32
33
super (registryName );
33
34
}
34
35
35
36
@ Override
36
37
protected void registerProperties () {
37
- this .register (MOUND_CUTOFF_RADIUS );
38
+ this .register (MOUND_CUTOFF_RADIUS , OFFSET );
38
39
}
39
40
40
41
@ Override
41
42
protected GenFeatureConfiguration createDefaultConfiguration () {
42
43
return super .createDefaultConfiguration ()
43
- .with (MOUND_CUTOFF_RADIUS , 5 );
44
+ .with (MOUND_CUTOFF_RADIUS , 5 )
45
+ .with (OFFSET , true );
44
46
}
45
47
46
48
/**
@@ -60,17 +62,9 @@ protected BlockPos preGenerate(GenFeatureConfiguration configuration, PreGenerat
60
62
BlockState initialDirtState = level .getBlockState (rootPos );
61
63
BlockState initialUnderState = level .getBlockState (rootPos .below ());
62
64
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
+ }
74
68
75
69
for (Cell cell : moundMap .getAllNonZeroCells ()) {
76
70
final BlockState placeState = cell .getValue () == 1 ? initialDirtState : initialUnderState ;
0 commit comments