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 revisionBoth sides next revision
tutorial:features [2020/01/08 12:07] lightcolourtutorial:features [2020/01/08 12:10] 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''
  
 `generate` is 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.  `generate` is 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. 
tutorial/features.txt · Last modified: 2023/12/18 01:19 by solidblock