User Tools

Site Tools


tutorial:features

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
tutorial:features [2020/01/08 12:07] lightcolourtutorial:features [2020/01/08 12:13] lightcolour
Line 1: Line 1:
 ===== 在您的世界中生成Feature ===== ===== 在您的世界中生成Feature =====
-Rocks, trees, ores, and ponds are all examples of Features. They are simple generation additions to the world which generate depending on how they are configured. In this tutorial, we'll look at generating a simple stone spiral feature in our world randomly. +岩石,树木,矿石和池塘都是Feature的示例。 它们是对世界的简单补充,它们的生成取决于它们的配置方式。 在本教程中,我们将研究如何在我们的世界中随机生成一个简单的石螺旋Feature。 
- +==== 创建Feature类 ==== 
-==== Creating a Feature class ==== +一个简单的Feature如下所示:
-A simple Feature looks like this:+
 <code java [enable_line_numbers="true"]> <code java [enable_line_numbers="true"]>
 public class StoneSpiralFeature extends Feature<DefaultFeatureConfig> { public class StoneSpiralFeature extends Feature<DefaultFeatureConfig> {
Line 26: Line 25:
 </code> </code>
  
-The constructor takes in a ''Function<Dynamic<? extends DefaultFeatureConfig>>'', which is a factory for data fixer config instances. You can pass in ''DefaultFeatureConfig::deserialize'' for default config features, either directly in the super call or when you instantiate the feature.+构造函数采用''Function<Dynamic<? extends DefaultFeatureConfig>>'',这是数据修复程序配置实例的工厂。 您可以直接在超级调用中或在实例化功能时为默认配置功能传递''DefaultFeatureConfig :: deserialize''
  
-`generateis called when the chunk decides to generate the feature. If the feature is configured to spawn every chunk, this would be called for each chunk being generated as well. In the case of the feature being configured to spawn at a certain rate per biome, `generate` would only be called in instances where the world wants to spawn the structure. +当块决定生成Feature时,将调用``generate``。 如果将功能配置为产生每个块,则也会为正在生成的每个块调用此功能。 在将功能配置为以每个生物群落以一定速率生成的情况下,仅在世界想要生成结构的情况下才调用``generate``。
  
-In our implementation, we'll build a simple 16-block tall spiral of stone starting at the top block in the world:+在我们的实现中,我们将从世界的最高位置开始构建一个简单的16块高的石头螺旋:
  
 <code java> <code java>
Line 58: Line 57:
  
 ==== 向生物群落添加Feature ==== ==== 向生物群落添加Feature ====
-生物群系有一种称为''addFeature''的方法,用于将特征添加到生物群落的生成过程中。 您可以在每个生物群落类(例如''ForestBiome''或''SavannaBiome'')中查看此方法的更详细用法。+生物群系有一种称为''addFeature''的方法,用于将Feature添加到生物群落的生成过程中。 您可以在每个生物群落类(例如''ForestBiome''或''SavannaBiome'')中查看此方法的更详细用法。
  
 我们可以遍历''Registry.BIOME''以将我们的Feature添加到每个生物群系中。 我们可以遍历''Registry.BIOME''以将我们的Feature添加到每个生物群系中。
tutorial/features.txt · Last modified: 2023/12/18 01:19 by solidblock