tutorial:structures
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
tutorial:structures [2019/05/26 16:34] – Syntax highlighting, more consistent formatting jamieswhiteshirt | tutorial:structures [2020/06/03 21:43] – 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 19: | Line 20: | ||
* shouldStartAt: | * shouldStartAt: | ||
* getName: name of your structure | * getName: name of your structure | ||
- | * method_14021 [getRadius]: radius of your structure, used for placement | + | * getRadius: radius of your structure, used for placement |
- | * method_13774 [getSeed]: a seed to use for generation, put 0 for testing | + | * getSeeedModifier |
You can pass DefaultFeatureConfig:: | You can pass DefaultFeatureConfig:: | ||
Line 28: | Line 29: | ||
<code java [enable_line_numbers=" | <code java [enable_line_numbers=" | ||
public static class MyStructureStart extends StructureStart { | public static class MyStructureStart extends StructureStart { | ||
- | public MyStructureStart (StructureFeature<?> | + | public MyStructureStart (StructureFeature<?> |
- | super(structureFeature_1, | + | super(feature, chunkX, chunkZ, box, references, seed); |
} | } | ||
@Override | @Override | ||
Line 48: | Line 49: | ||
This is where structure files and generating straight from a generate method part ways. There are two ways to go about this: | This is where structure files and generating straight from a generate method part ways. There are two ways to go about this: | ||
- | * If you want, you can simply override generate in your Feature class and use setBlockState to place blocks directly in the world. This is a valid option and was popular pre-1.13. | + | |
- | * Use structure files and a Generator. These are rather powerful at this point and are highly recommended. | + | * Use structure files and a Generator. These are rather powerful at this point and are highly recommended. |
==== Creating a Generator ==== | ==== Creating a Generator ==== | ||
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.addFeature(GenerationStep.Feature.SURFACE_STRUCTURES, |
} | } | ||
} | } |
tutorial/structures.txt · Last modified: 2022/11/05 12:06 by jab125