User Tools

Site Tools


tutorial:structures

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tutorial:structures [2019/07/02 00:50]
draylar
tutorial:structures [2020/06/03 21:43] (current)
ffrann
Line 6: Line 6:
  
 ==== Introduction ==== ==== Introduction ====
 +This page is old, and will need to be rewritten once 1.16 is released, accounting new structure registry changes.  ​
  
 We’re going to look at registering and placing structures in your world. We’re going to look at registering and placing structures in your world.
  
-To view examples of 1.14 vanilla structures in action, IglooGenerator & IglooFeature are a good place to start.+To view examples of 1.14 vanilla structures in action, IglooGenerator & IglooFeature are a good place to start. ​
  
 You are going to need a Feature and Generator for the most basic structure. The feature handles the process of registering the structure and loading it in when the world is generating-- it answers questions such as ‘should I spawn here?’ and ‘what is my name?’ The generator handles the placement of blocks or loading in a structure file if you choose to do so. You are going to need a Feature and Generator for the most basic structure. The feature handles the process of registering the structure and loading it in when the world is generating-- it answers questions such as ‘should I spawn here?’ and ‘what is my name?’ The generator handles the placement of blocks or loading in a structure file if you choose to do so.
Line 28: Line 29:
 <code java [enable_line_numbers="​true"​]>​ <code java [enable_line_numbers="​true"​]>​
 public static class MyStructureStart extends StructureStart { public static class MyStructureStart extends StructureStart {
-    public MyStructureStart (StructureFeature<?> ​structureFeature_1, int int_1, int int_2Biome biome_1, MutableIntBoundingBox mutableIntBoundingBox_1, int int_3, long long_1) { +    public MyStructureStart (StructureFeature<?> ​feature, int chunkX, int chunkZBlockBox box, int references, long seed) { 
-        super(structureFeature_1,​ int_1int_2biome_1mutableIntBoundingBox_1int_3long_1);+        super(featurechunkXchunkZboxreferencesseed);
     }     }
     @Override     @Override
Line 174: Line 175:
 for(Biome biome : Registry.BIOME) { for(Biome biome : Registry.BIOME) {
     if(biome.getCategory() != Biome.Category.OCEAN && biome.getCategory() != Biome.Category.RIVER) {     if(biome.getCategory() != Biome.Category.OCEAN && biome.getCategory() != Biome.Category.RIVER) {
-        biome.addStructureFeature(myFeature, new DefaultFeatureConfig()); +        biome.addStructureFeature(myFeature.configure(FeatureConfig.DEFAULT)); 
-        biome.addFeature(GenerationStep.Feature.SURFACE_STRUCTURES, ​Biome.configureFeature(myFeature,​ new DefaultFeatureConfig()Decorator.CHANCE_PASSTHROUGHnew ChanceDecoratorConfig(0)));​+        biome.addFeature(GenerationStep.Feature.SURFACE_STRUCTURES, ​myFeature.configure(FeatureConfig.DEFAULT).createDecoratedFeature(Decorator.CHANCE_PASSTHROUGH.configure(new ChanceDecoratorConfig(0))));
     }     }
 } }
tutorial/structures.1562028659.txt.gz · Last modified: 2019/07/02 00:50 by draylar