zh_cn:tutorial:features
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
zh_cn:tutorial:features [2021/07/12 01:12] – [注册一个Feature] solidblock | zh_cn:tutorial:features [2021/07/12 01:17] – [向生物群落添加Feature] solidblock | ||
---|---|---|---|
Line 74: | Line 74: | ||
Decorator表示世界如何选择放置该特征。要选择正确的Decorator,检查原版的地形特征,你自己的应该要类似。装饰器配置是从这个分支出来的,在'' | Decorator表示世界如何选择放置该特征。要选择正确的Decorator,检查原版的地形特征,你自己的应该要类似。装饰器配置是从这个分支出来的,在'' | ||
- | ==== 向生物群落添加Feature | + | ==== 向生物群系添加特征地形 |
- | 生物群系有一种称为'' | + | 我们使用生物群系修改API。 |
- | 我们可以遍历'' | ||
<code java> | <code java> | ||
- | Registry.BIOME.forEach(biome -> biome.addFeature( | + | public class ExampleMod implements ModInitializer { |
- | | + | [...] |
- | Biome.configureFeature( | + | |
- | LAVA_HOLE, | + | |
- | new DefaultFeatureConfig(), | + | |
- | Decorator.CHANCE_HEIGHTMAP, | + | |
- | new ChanceDecoratorConfig(100) | + | |
- | ) | + | |
- | )); | + | |
- | </ | + | |
- | '' | + | @Override |
+ | public void onInitialize() { | ||
+ | [...] | ||
+ | BiomeModifications.addFeature(BiomeSelectors.all(), | ||
+ | } | ||
+ | } | ||
+ | </ | ||
- | '' | + | '' |
- | 装饰器代表世界如何选择放置要素。 '' | + | 第二个参数帮助你确定结构何时生成。对于地上的房子,可以用'' |
=== 结果 === | === 结果 === | ||
{{https:// | {{https:// |
zh_cn/tutorial/features.txt · Last modified: 2022/08/18 03:37 by solidblock