User Tools

Site Tools


zh_cn:tutorial:terms

Differences

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

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
zh_cn:tutorial:terms [2019/12/18 10:21] – created lightcolourzh_cn:tutorial:terms [2021/07/30 07:04] – 依照中文 FabricWiki 翻译标准和中文文案排版指北进行排 nkid00
Line 1: Line 1:
-====== Learning Conventions & Terminology ======+====== 惯用词和术语 ======
  
- +在开始用 Fabric 写 mod 之前,重要的是要了解以后的教程页面中使用的一些关键术语和短语。 了解诸如包结构和 modid 命名之类的基本约定也很好。 尽早了解这些内容将有助于您更好地理解教程,并在需要时提出更好的问题。
-Before starting with Fabric modding, it's important to understand some of the key terms and phrases used in future tutorial pages. It's also good to know basic conventions for things such as package structure and modid naming. Knowing these early will help you to understand tutorials better and enable you to ask better questions when needed.+
  
 ==== Mod ID ==== ==== Mod ID ====
-Throughout the documentation, we'll often refer to a Mod ID, or modid in code. Mod ID stands for "Mod Identifier," and it is a string that should uniquely identify your mod. Mod IDs are commonly associated with identifier namespaces of the same name, and as such, follow the same restrictions. Mod IDs can consist only of lowercase characters ''a-z'', numbers ''0-9'', and the symbols ''_-''. For example, Minecraft uses the ''minecraft'' namespace. Additionally, a mod ID must consist of at least two characters. 
  
-mod ID is often compact version of the name of the mod which makes it short but recognizeable and prevents naming conflicts. Conventionally, a project named "My Project--" could be called ''myproject''''my_project'', or in some cases, ''my-project'' also worksbut dashes in modids can be a slight pain to deal with at times [citation needed]. This mod would register items and blocks using this mod ID as a registry namespace.+在整个文档中,我们通常会引用 Mod ID 或代码中的 modid。 Mod ID 代表 ''Mod Identifier'',它是一个字符串,应该唯一地标识您的 mod。 Mod ID 通常与同名的标识符命名空间相关联,因此遵循与之相同的限制。Mod ID 只能由小写字母 ''a-z'',数字 ''0-9'' 和符号 ''_-'' 组成。 例如,Minecraft 使用 ''minecraft'' 命名空间。此外,模组 ID 必须至少包含两个字符。 
 + 
 +mod ID 通常是 mod 名称的紧凑版本,使其简短但可识别并防止命名冲突。按照惯例,名为 “My Project--” 的项目可以称为 ''myproject''''my_project'',或者在某些情况下也可以使用 ''my-project'',但是modid中的连字符可能会有些不好处理[需要引用]。此 mod 将使用此 mod ID 作为注册表命名空间来注册物品和方块。 
 + 
 +一些入门教程将使用占位符 mod ID 并在占位符命名空间下注册物品和放块,您可以将其视为入门模板-尽管保持这个不变对测试影响不大,但请记住发布项目之前更改。 
 + 
 +==== 标签 ==== 
 + 
 +Tags are groups of blocksitems, or fluids with similar properties, i.e. ''minecraft:saplings'' contains all of the game's saplings. 
 +Information about what to call tags for your mod can be found [[tutorial:tags|here]].  
 + 
 +Read more on what tags are on the [[https://minecraft.gamepedia.com/Tag|Minecraft Wiki]] 
 + 
 +==== Entry Points and Initializers ==== 
 +Fabric Loader use ''fabric.mod.json'' to detect and load your mod. 
 + 
 +A mod usually contains at least one initializer class which should implement one of ''ModInitializer'', ''ClientInitializer'' and ''ServerInitializer''. The interfaces are all in the ''net.fabricmc.api'' package. In order to change or add initializers, you need to edit ''fabric.mod.json'' and find ''entrypoints'' block, then edit them accordingly. ''main'' block is for Mod Initializers, ''client'' block is for Client Mod Initializers and ''server'' block is for Server Mod Initializers. 
 + 
 +<code java> 
 +
 +  [...] 
 +  "entrypoints":
 +    "main":
 +      "net.fabricmc.ExampleMod" 
 +    ], 
 +    "client":
 +      "net.fabricmc.ExampleClientMod" 
 +    ] 
 +  } 
 +  [...] 
 +
 +</code>
  
-Some of the starter tutorials will use a placeholder mod ID and register items and blocks under a placeholder namespaceand you can think of it as a starter template-- while leaving this unchanged is not dangerous for testingremember to change it if you intend to release your project.+By implementing Mod Initializer interfaces, you must implement an ''onInitializing()'' (or ''onInitializeClient()'' for Client''onInitializeServer()'' for Server) function. You can then write your codes there.
  
-==== Tags ==== +Also, there is a block called ''initializers''.
-Draft. Edit it.+
  
-Convention namespace for tags is ''c''.+==== Maven 组和软件包名称 ====
  
-==== Maven Group & Package Names ==== +根据 Oracle 的 Java 文档,它们以小写形式编写,以避免与类或接口的名称冲突。域名反过来用作启动名称。前往这个链接阅读更多:[[https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html]]
-According to Oracle'Java documentation, they are written in all lower case to avoid conflict with the names of classes or interfaces. The reverse of your domain name is used to start the names. Read more at [[https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html]].+
zh_cn/tutorial/terms.txt · Last modified: 2022/03/20 13:33 by solidblock