User Tools

Site Tools


zh_cn:tutorial:jigsaw

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
zh_cn:tutorial:jigsaw [2020/02/06 04:22] lightcolourzh_cn:tutorial:jigsaw [2020/02/24 02:59] (current) – [创建一个StructureStart类] lightcolour
Line 115: Line 115:
 {{https://i.imgur.com/owaJ0k2.png|Blank Jigsaw}} {{https://i.imgur.com/owaJ0k2.png|Blank Jigsaw}}
  
-When thinking about this as a puzzlethe target pool is the group of puzzle pieces you can search throughIf you have a total of 10 pieces, one target pool may have of the total piecesThis field is how a jigsaw specifies, "Hi, I'd like a piece from group to connect to me!" In the case of a village, this may be a road saying, "Give me a house!" The target pools of jigsaws do not have to match: the requestor gets to decide who they select from. It is **not** defining what type //the given// jigsaw block is, but rather what type should be on the //other side//.+将其视为难题时,目标池就是您可以搜索的一组难题如果您共有10件,那么一个目标池可能有7拼图是如何在此字段中指定的:"嗨,我希望B组的一块可以和我联系!" 就一个村庄而言,这可能是一条路,说:“给我房子!” 2个拼图的目标池不必匹配:请求者可以决定从中选择谁。 **不是**定义给定的//拼图块是什么类型,而是应该定义另一种类型///.
  
-The attachment type can be seen as a more specific filter within target pools-- a jigsaw can only connect to other jigsaws with the same attachment type. This is like the type of connector on a puzzle piece. The usages for this are a little bit more specific.+附件类型可以看作是目标池中更具体的过滤器-拼图只能连接到具有相同附件类型的其他拼图。 这就像拼图块上的连接器类型。 用法更加具体.
  
-Finally, the "turns into" field is simply what the jigsaw is replaced with after it finds a match. If the jigsaw is inside your cobblestone floor, it should probably turn into cobblestone+最后,“turns into”字段只是拼图找到匹配项后所替换的内容。 如果拼图位于您的鹅卵石地板内,它可能会变成原石
- +这是一个示例实现:给定的拼图将从// tutorial:my_pool //结构池中绘制,查找具有// tutorial:any //类型的所有拼图,并在完成后变成原石。
-Here's an example implementation: the given jigsaw will draw from the //tutorial:my_pool// structure pool, looks for any jigsaws with the //tutorial:any// type, and turns into cobblestone when it's done.+
  
 {{https://i.imgur.com/f9tP2sv.png|Example Finished Jigsaw}} {{https://i.imgur.com/f9tP2sv.png|Example Finished Jigsaw}}
Line 189: Line 188:
 </code> </code>
  
-Here, we're registering pools (base & color) and then adding their respective children to them. The StructurePool constructor is as follows+在这里,我们要注册2个池(基础和颜色),然后将它们各自的子级添加到它们中。 StructurePool构造函数如下
- registry name of the pool, same as target pool at top of a jigsaw +*池的注册表名称,与竖锯顶部的目标池相同 
- * @Draylar if you know what this one does +  *@Draylar,如果您知道这是做什么的 
- a list of pool elements +  *池元素列表 
- the projection type of the pool +  *池的投影类型 
- +对于元素列表,我们添加池元素和整数的Pairs((com.mojang.datafixers.util))。 传递到元素的字符串是结构在数据目录中的位置,而int是元素在整个目标池中的权重。 对每个元素使用1可以确保每个元素被均匀地拾取.
-For the list of elements, we add Pairs((com.mojang.datafixers.util)) of pool elements and integers. The string passed into the element is the location of the structure in the data directory, and the int is the weight of the element within the entire target pool. Using for each element ensures each one will be picked evenly.+
  
-The projection is how the pool is placed in the world. Rigid means it will be placed directly as is, and terrain matching means it will be bent to sit on top of the terrain. The latter may be good for a wheat field structure that moves with the terrain shape, whereas the first would be better for houses with solid floors.+投影是如何将池放置在世界上的。 刚性表示将直接按原样放置,而地形匹配则表示将其弯曲以位于地形顶部。 后者可能适合随地形变化的麦田结构,而前者则适合具有坚固地板的房屋。
    
-Now all we have to do is add our starting piece in our ''initialize'' method:+现在,我们要做的就是在''initialize''方法中添加起始片段:
 <code java [enable_line_numbers="false"]> <code java [enable_line_numbers="false"]>
 @Override @Override
Line 207: Line 205:
 } }
 </code> </code>
-The Identifier is the starting pool to select from, the int is the size of the entire structure (with being "7 squares out"), and the 3rd argument is a factory for the piece we'll register in a second.+Identifier是可供选择的起始池,int是整个结构的大小(其中7为“7 squares out”),第3个参数是我们将在第二秒注册的零件的工厂.
  
 ==== 创作作品 ==== ==== 创作作品 ====
zh_cn/tutorial/jigsaw.1580962954.txt.gz · Last modified: 2020/02/06 04:22 by lightcolour