zh_cn:tutorial:ores
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
zh_cn:tutorial:ores [2021/09/23 00:12] – [在世界中添加矿石] solidblock | zh_cn:tutorial:ores [2021/09/23 00:15] – [在群系中添加矿石] solidblock | ||
---|---|---|---|
Line 7: | Line 7: | ||
我们假设您此时已经创建了自己的矿石。本教程中,我们使用羊毛方块进行替换。你可以适时将羊毛改成你自己的矿石。 | 我们假设您此时已经创建了自己的矿石。本教程中,我们使用羊毛方块进行替换。你可以适时将羊毛改成你自己的矿石。 | ||
- | ==== 在群系中添加矿石 | + | ==== 添加到主世界生物群系 |
+ | 本段落将会在主世界生成矿石。 | ||
- | 首先,我们需要创建一种方法来处理生物群系,检查其是否为有效的生物群系,然后添加矿石。 | + | 我们需要创建一个 ConfiguredFeature,确保在 '' |
- | <code java [enable_line_numbers=" | + | |
- | private void handleBiome(Biome biome) | + | <code java> |
- | if(biome.getCategory() != Biome.Category.NETHER && biome.getCategory() != Biome.Category.THEEND) { | + | public class ExampleMod implements ModInitializer |
- | biome.addFeature( | + | |
- | GenerationStep.Feature.UNDERGROUND_ORES, | + | .configure(new OreFeatureConfig( |
- | | + | OreFeatureConfig.Rules.BASE_STONE_OVERWORLD, |
- | Feature.ORE, | + | Blocks.WHITE_WOOL.getDefaultState(), |
- | new OreFeatureConfig( | + | |
- | OreFeatureConfig.Target.NATURAL_STONE, | + | .range(new RangeDecoratorConfig( |
- | Blocks.NETHER_QUARTZ_ORE.getDefaultState(), | + | // You can also use one of the other height providers if you don't want a uniform distribution |
- | | + | |
- | | + | |
- | Decorator.COUNT_RANGE, | + | |
- | new RangeDecoratorConfig( | + | |
- | | + | @Override |
- | 0, //Bottom Offset | + | public void onInitialize() { |
- | 0, //Min y level | + | RegistryKey< |
- | | + | new Identifier(" |
- | ))); | + | |
- | } | + | BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), |
+ | | ||
} | } | ||
</ | </ | ||
- | 此方法通过提供的生成设置将您的矿石添加到整个世界。 | + | === 结果 === |
+ | 检查你的世界生成结果时,记得要创建新世界。你应该看见羊毛在主世界生成了。你可以使用下面的命令移除周围的石头方块。 | ||
+ | < | ||
+ | /fill ~-8 0 ~-8 ~8 ~ ~8 minecraft: | ||
+ | </ | ||
+ | |||
+ | {{tutorial: | ||
==== 迭代生物群系注册表 ==== | ==== 迭代生物群系注册表 ==== |
zh_cn/tutorial/ores.txt · Last modified: 2023/12/18 01:03 by solidblock