zh_cn:tutorial:jigsaw
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
zh_cn:tutorial:jigsaw [2020/02/05 04:52] – created lightcolour | zh_cn:tutorial:jigsaw [2020/02/06 04:19] – [Creating a Piece] lightcolour | ||
---|---|---|---|
Line 17: | Line 17: | ||
</ | </ | ||
- | // | + | // |
<code java [enable_line_numbers=" | <code java [enable_line_numbers=" | ||
@Override | @Override | ||
Line 26: | Line 25: | ||
</ | </ | ||
- | // | + | // |
- | * Serializing and Deserializing your structure from a chunk | + | |
- | * Locating your structure | + | |
- | * Labeling your structure | + | |
- | Vanilla convention is a properly capitalized title. "Igloo," "Village," and "Fortress," are all valid.((Do not use a '' | + | 原版约定是适当大写的标题。'' |
<code java [enable_line_numbers=" | <code java [enable_line_numbers=" | ||
@Override | @Override | ||
Line 38: | Line 37: | ||
</ | </ | ||
- | The exact usage for // | + | // |
<code java [enable_line_numbers=" | <code java [enable_line_numbers=" | ||
@Override | @Override | ||
Line 45: | Line 44: | ||
} | } | ||
</ | </ | ||
- | + | 最后,// | |
- | Finally, | + | |
<code java [enable_line_numbers=" | <code java [enable_line_numbers=" | ||
@Override | @Override | ||
Line 53: | Line 51: | ||
} | } | ||
</ | </ | ||
- | + | 我们完成的'' | |
- | Our finalized | + | |
<code java [enable_line_numbers=" | <code java [enable_line_numbers=" | ||
import com.mojang.datafixers.Dynamic; | import com.mojang.datafixers.Dynamic; | ||
Line 213: | Line 210: | ||
The Identifier is the starting pool to select from, the int is the size of the entire structure (with 7 being "7 squares out"), and the 3rd argument is a factory for the piece we'll register in a second. | The Identifier is the starting pool to select from, the int is the size of the entire structure (with 7 being "7 squares out"), and the 3rd argument is a factory for the piece we'll register in a second. | ||
- | ==== Creating a Piece ==== | + | ==== 创作作品 |
- | This portion is very simple. A piece represents one section or element in your full structure. You'll need to create a basic piece class, and we'll register it later: | + | 这部分非常简单。 一块代表整个结构中的一个部分或元素。 您需要创建一个基本的计件类,稍后我们将进行注册: |
<code java [enable_line_numbers=" | <code java [enable_line_numbers=" | ||
public class ExamplePiece extends PoolStructurePiece { | public class ExamplePiece extends PoolStructurePiece { | ||
Line 228: | Line 225: | ||
</ | </ | ||
- | Where '' | + | 其中'' |
- | ==== Registering Everything | + | ==== 注册所有 |
- | We'll need to register our structure as both a feature | + | 我们需要将结构既注册为特征//和//还是结构特征,并注册我们的作品。 将结构注册为StructureFeature是可选的,并且用于将其保存到块中。 如果世界在您的结构加载过程中途中止,则在重新打开世界后对其进行注册将使其继续存在。 如果未将其注册到结构特征中,并且发生了这种情况,则该结构将中途停止(大多数情况下只会发生在较大的,多块宽的结构中)。 |
<code java [enable_line_numbers=" | <code java [enable_line_numbers=" | ||
public static final StructureFeature< | public static final StructureFeature< | ||
Line 252: | Line 249: | ||
</ | </ | ||
- | ==== Spawning Our Structure | + | ==== 生成我们的结构 |
- | Finally, we'll have to spawn our structure. A basic example which adds it to every biome is: | + | 最后,我们必须生成我们的结构。 将其添加到每个生物群系的一个基本示例是: |
<code java [enable_line_numbers=" | <code java [enable_line_numbers=" | ||
Registry.BIOME.forEach(biome -> { | Registry.BIOME.forEach(biome -> { | ||
Line 261: | Line 258: | ||
</ | </ | ||
- | === Finished! === | + | === 完成! === |
- | As you can see, we have a single white square in the center, with boxes going off the edges. Note that the radius in this screenshot was increased to 14 instead of the 7 used in the tutorial. | + | 如您所见,我们在中心有一个白色正方形,框在边缘之外。 请注意,此屏幕截图中的半径已增加到14,而不是本教程中使用的7。 |
- | {{https:// | + | {{https:// |
zh_cn/tutorial/jigsaw.txt · Last modified: 2020/02/24 02:59 by lightcolour