User Tools

Site Tools


tutorial:features

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
tutorial:features [2019/11/02 01:58] – created draylartutorial:features [2020/07/16 20:20] – update IWorld references to WorldAccess user11681
Line 12: Line 12:
  
     @Override     @Override
-    public boolean generate(IWorld world, ChunkGenerator<? extends ChunkGeneratorConfig> chunkGenerator, Random random, BlockPos pos, DefaultFeatureConfig config) {+    public boolean generate(WorldAccess world, ChunkGenerator<? extends ChunkGeneratorConfig> chunkGenerator, Random random, BlockPos pos, DefaultFeatureConfig config) {
         BlockPos topPos = world.getTopPosition(Heightmap.Type.WORLD_SURFACE, pos);         BlockPos topPos = world.getTopPosition(Heightmap.Type.WORLD_SURFACE, pos);
         Direction offset = Direction.NORTH;         Direction offset = Direction.NORTH;
Line 34: Line 34:
 <code java> <code java>
 @Override @Override
-public boolean generate(IWorld world, ChunkGenerator<? extends ChunkGeneratorConfig> chunkGenerator, Random random, BlockPos pos, DefaultFeatureConfig config) {+public boolean generate(WorldAccess world, ChunkGenerator<? extends ChunkGeneratorConfig> chunkGenerator, Random random, BlockPos pos, DefaultFeatureConfig config) {
     BlockPos topPos = world.getTopPosition(Heightmap.Type.WORLD_SURFACE, pos);     BlockPos topPos = world.getTopPosition(Heightmap.Type.WORLD_SURFACE, pos);
     Direction offset = Direction.NORTH;     Direction offset = Direction.NORTH;
Line 64: Line 64:
 Registry.BIOME.forEach(biome -> biome.addFeature( Registry.BIOME.forEach(biome -> biome.addFeature(
         GenerationStep.Feature.RAW_GENERATION,         GenerationStep.Feature.RAW_GENERATION,
- Biome.configureFeature( + LAVA_HOLE.configure(new DefaultFeatureConfig()) 
- LAVA_HOLE, + .createDecoratedFeature(Decorator.CHANCE_HEIGHTMAP.configure(new ChanceDecoratorConfig(100)));
- new DefaultFeatureConfig(), +
- Decorator.CHANCE_HEIGHTMAP+
- new ChanceDecoratorConfig(100) +
- )+
 )); ));
 </code> </code>
  
-The first argument of 'addFeature'' helps determine when the structure is generated. For above-ground houses you may go with ''SURFACE_STRUCTURES'', and for caves, you might go with ''RAW_GENERATION''.+The first argument of ''addFeature'' helps determine when the structure is generated. For above-ground houses you may go with ''SURFACE_STRUCTURES'', and for caves, you might go with ''RAW_GENERATION''.
  
 The second argument of ''addFeature'' is a ConfiguredFeature, which you can create through ''Biome.configureFeature''. The latter takes in an instance of your feature, an instance of your feature's config class, a decorator, and a decorator config. The second argument of ''addFeature'' is a ConfiguredFeature, which you can create through ''Biome.configureFeature''. The latter takes in an instance of your feature, an instance of your feature's config class, a decorator, and a decorator config.
Line 80: Line 76:
  
 === Results === === Results ===
 +{{https://i.imgur.com/Kr59o0B.png}}
tutorial/features.txt · Last modified: 2023/12/18 01:19 by solidblock