From 29f86afd622a93d15f3d637a601947d3c23012ee Mon Sep 17 00:00:00 2001 From: Ginsway Date: Sat, 13 Jan 2024 17:45:10 +0800 Subject: [PATCH 1/8] base --- src/lib/translations/index.ts | 18 +++- src/lib/translations/lang.js | 3 +- src/lib/translations/zh_cn/application.json | 13 +++ src/lib/translations/zh_cn/error.json | 5 + src/lib/translations/zh_cn/wiki.json | 100 ++++++++++++++++++++ wiki/introduction/get-started/zh_cn.md | 47 +++++++++ 6 files changed, 184 insertions(+), 2 deletions(-) create mode 100644 src/lib/translations/zh_cn/application.json create mode 100644 src/lib/translations/zh_cn/error.json create mode 100644 src/lib/translations/zh_cn/wiki.json create mode 100644 wiki/introduction/get-started/zh_cn.md diff --git a/src/lib/translations/index.ts b/src/lib/translations/index.ts index 5e72f922..8c55a18b 100644 --- a/src/lib/translations/index.ts +++ b/src/lib/translations/index.ts @@ -15,7 +15,8 @@ export const config: Config<{ placeholder?: string }> = { parser: parser(), translations: { en: { lang }, - fr: { lang } + fr: { lang }, + zh_cn: { lang } }, loaders: [ { @@ -47,6 +48,21 @@ export const config: Config<{ placeholder?: string }> = { locale: "fr", key: "wiki", loader: async () => (await import("./fr/wiki.json")).default + }, + { + locale: "zh_cn", + key: "application", + loader: async () => (await import("./zh_cn/application.json")).default + }, + { + locale: "zh_cn", + key: "error", + loader: async () => (await import("./zh_cn/error.json")).default + }, + { + locale: "zh_cn", + key: "wiki", + loader: async () => (await import("./zh_cn/wiki.json")).default } ], log: { level: dev ? "warn" : "error" } diff --git a/src/lib/translations/lang.js b/src/lib/translations/lang.js index 117be2ad..16f67ccb 100644 --- a/src/lib/translations/lang.js +++ b/src/lib/translations/lang.js @@ -1,4 +1,5 @@ export default { en: "English", - fr: "Français" + fr: "Français", + zh_cn: "简体中文" }; diff --git a/src/lib/translations/zh_cn/application.json b/src/lib/translations/zh_cn/application.json new file mode 100644 index 00000000..d6dac96b --- /dev/null +++ b/src/lib/translations/zh_cn/application.json @@ -0,0 +1,13 @@ +{ + "title": "Quilt开发Wiki :P", + "dev-notice": "注意:本网站仍在开发中。请在<{{placeholder}}>中报告发现的问题", + "translation-notice": "请注意,此wiki的原始语言为英语,翻译版本可能与英语版本不同步", + "draft-notice": "You were linked to a page in the wiki that is planned, but not yet implemented. If you want to help building out this wiki, go and take a look at <{{placeholder}}>", + "sidebar": { + "menu": "菜单", + "articles": "文章" + }, + "lang-dropdown": { + "language": "语言" + } +} diff --git a/src/lib/translations/zh_cn/error.json b/src/lib/translations/zh_cn/error.json new file mode 100644 index 00000000..82323ee7 --- /dev/null +++ b/src/lib/translations/zh_cn/error.json @@ -0,0 +1,5 @@ +{ + "title": "Error {{placeholder}}", + "404": "未找到页面:`{{placeholder}}`", + "500": "The server encoutered an internal error, please try again" +} diff --git a/src/lib/translations/zh_cn/wiki.json b/src/lib/translations/zh_cn/wiki.json new file mode 100644 index 00000000..c486c1a1 --- /dev/null +++ b/src/lib/translations/zh_cn/wiki.json @@ -0,0 +1,100 @@ +{ + "not-translated": "此wiki页面尚未被翻译为{{placeholder}}", + "not-found": "未找到页面:`{{placeholder}}`", + "blocks": { + "title": "方块", + "first-block": { + "title": "添加一个简单方块" + }, + "oriented-block": { + "title": "添加一个定向方块" + }, + "redstone-interaction": { + "title": "添加红石功能到你的方块" + } + }, + "concepts": { + "title": "概念", + "events": { + "title": "事件" + }, + "libraries": { + "title": "第三方库列表" + }, + "lifecycles-ticks": { + "title": "Lifecycles and Ticks" + }, + "minecraft-code-structure": { + "title": "Minecraft’s Code Structure" + }, + "mixins": { + "title": "Mixins" + }, + "nbt": { + "title": "NBT and Data in Minecaft" + }, + "networking": { + "title": "Networking" + }, + "qsl-qfapi": { + "title": "QSL和QFAPI概述" + }, + "registries": { + "title": "Registries" + }, + "sideness": { + "title": "Server-Side and Client-Side" + } + }, + "data": { + "title": "Data", + "adding-recipes": { + "title": "Adding Recipes" + }, + "rea": { + "title": "Using Registry Entry Attachments (REA)" + }, + "recipe-api": { + "title": "Recipe API" + }, + "recipe-type": { + "title": "Adding a Recipe Type" + }, + "resource-loader": { + "title": "Resource Loader" + } + }, + "introduction": { + "title": "介绍", + "get-started": { + "title": "Quilt开发入门" + }, + "setting-up": { + "title": "配置开发环境" + } + }, + "items": { + "title": "物品", + "armor": { + "title": "添加盔甲" + }, + "first-item": { + "title": "创建你的第一个物品" + }, + "food": { + "title": "添加食物" + }, + "tools": { + "title": "添加自定义工具" + } + }, + "misc": { + "title": "Misc", + "commands": { + "title": "Adding Commands" + }, + "sounds": { + "title": "Adding Sounds" + } + } +} diff --git a/wiki/introduction/get-started/zh_cn.md b/wiki/introduction/get-started/zh_cn.md new file mode 100644 index 00000000..045d3cae --- /dev/null +++ b/wiki/introduction/get-started/zh_cn.md @@ -0,0 +1,47 @@ +# Quilt开发入门 + +## 基本要求 + +为了开始修改Minecraft,你需要知道一些事情。 + +- Java基础知识。这包括理解其语法,面向对象编程以及一些基本的设计模式。 +- [Git](https://git-scm.com/)基础知识。虽然技术上没有必要,但它会让你的开发轻松很多。这包括如何克隆存储库并提交代码。 + +TODO: 这里还有什么需要描述的吗? + +## How to Use this Wiki + +TODO: Create example code repository and put it here + +This wiki contains pages that are best read in order. Many of the articles, especially at the beginning, suggest other articles sensible to continue with. Most pages will contain code snippets, with full examples planned to be provided in example mods. (This is not done yet) + +Additionally, you might account lines prefixed with `TODO:`. Those are notes for people working on the wiki what still needs to be done. For now, you can ignore them. Just know that there is more content to be inserted there. + +TODO: Give an outline of all of the wiki articles once they're ready + +## How to Learn Modding, for Beginners + +Minecraft modding can get complicated. We aim to provide a resource to help you learn +fundamental modding concepts. However, there are some things that we can't do and +expect you to learn on your own. + +Asking questions properly, whether it is on our forum or on Discord, is an essential +skill to have. Never be afraid to ask questions, we're always willing to help, and we +don't judge. + +TODO: Methodology for asking questions here + +Many problems have been solved in modding before, and are publicly available for you +to see and use as most mods for Quilt are open source. We recommend that you look at +examples of how to do things in open source repositories and sometimes "steal" code. +Open source repositories are there for you to learn from and use, don't be afraid of +them! + +TODO: Levi write your thing about stealing code here + +## Differences between Fabric and Quilt + +Quilt is a fork of the Fabric modloader. However, there are some key differences with +Quilt when compared with Fabric. + +TODO: Levi write your thing here From 26193f77b9bfdeae0594b5721e5bab07d7a681ee Mon Sep 17 00:00:00 2001 From: Ginsway Date: Sun, 21 Jan 2024 19:26:35 +0800 Subject: [PATCH 2/8] update --- src/lib/translations/zh_cn/wiki.json | 2 +- wiki/introduction/get-started/zh_cn.md | 39 ++--- wiki/introduction/setting-up/zh_cn.md | 209 +++++++++++++++++++++++++ 3 files changed, 225 insertions(+), 25 deletions(-) create mode 100644 wiki/introduction/setting-up/zh_cn.md diff --git a/src/lib/translations/zh_cn/wiki.json b/src/lib/translations/zh_cn/wiki.json index c486c1a1..642e30c1 100644 --- a/src/lib/translations/zh_cn/wiki.json +++ b/src/lib/translations/zh_cn/wiki.json @@ -70,7 +70,7 @@ "title": "Quilt开发入门" }, "setting-up": { - "title": "配置开发环境" + "title": "建立开发环境" } }, "items": { diff --git a/wiki/introduction/get-started/zh_cn.md b/wiki/introduction/get-started/zh_cn.md index 045d3cae..97f769b6 100644 --- a/wiki/introduction/get-started/zh_cn.md +++ b/wiki/introduction/get-started/zh_cn.md @@ -2,46 +2,37 @@ ## 基本要求 -为了开始修改Minecraft,你需要知道一些事情。 +为了开始修改Minecraft,你需要知道一些基础知识。 - Java基础知识。这包括理解其语法,面向对象编程以及一些基本的设计模式。 - [Git](https://git-scm.com/)基础知识。虽然技术上没有必要,但它会让你的开发轻松很多。这包括如何克隆存储库并提交代码。 -TODO: 这里还有什么需要描述的吗? +TODO:这里还有什么需要描述的吗? -## How to Use this Wiki +## 如何使用此Wiki -TODO: Create example code repository and put it here +TODO:创建示例代码仓库并将其放在此处 -This wiki contains pages that are best read in order. Many of the articles, especially at the beginning, suggest other articles sensible to continue with. Most pages will contain code snippets, with full examples planned to be provided in example mods. (This is not done yet) +此wiki包含按顺序阅读效果最好的页面。许多文章,尤其是在开头,建议继续阅读其他合理的文章。大多数页面都会包含代码片段,并计划在示例mods中提供完整的示例。(这还没有完成) Additionally, you might account lines prefixed with `TODO:`. Those are notes for people working on the wiki what still needs to be done. For now, you can ignore them. Just know that there is more content to be inserted there. -TODO: Give an outline of all of the wiki articles once they're ready +TODO:准备好后,列出所有wiki文章的大纲 -## How to Learn Modding, for Beginners +## 初学者如何学习模组 -Minecraft modding can get complicated. We aim to provide a resource to help you learn -fundamental modding concepts. However, there are some things that we can't do and -expect you to learn on your own. +Minecraft的模组制作可能很复杂。我们旨在提供资源帮助您学习基本的编写概念。但有些事情我们做不到,所以希望你自己学习。 -Asking questions properly, whether it is on our forum or on Discord, is an essential -skill to have. Never be afraid to ask questions, we're always willing to help, and we -don't judge. +正确提问,无论是在我们的论坛上还是在Discord上,都是一项必不可少的技能。永远不要害怕问问题,我们愿意提供帮助,而且我们不会评判你的问题。。 -TODO: Methodology for asking questions here +TODO: 此处的提问方法 -Many problems have been solved in modding before, and are publicly available for you -to see and use as most mods for Quilt are open source. We recommend that you look at -examples of how to do things in open source repositories and sometimes "steal" code. -Open source repositories are there for you to learn from and use, don't be afraid of -them! +许多问题已经在其他模组中解决了,并可供您公开使用查看和使用,因为使用Quilt的大多数模组都是开源的。我们建议您查看如何在开源存储库中做事的示例,有时还会“窃取”代码。开源存储库供您学习和使用,不要害怕他们。 -TODO: Levi write your thing about stealing code here +TODO: Levi,在这里写下你偷代码的事(原文如此) -## Differences between Fabric and Quilt +## Fabric和Quilt的区别 -Quilt is a fork of the Fabric modloader. However, there are some key differences with -Quilt when compared with Fabric. +Quilt是Fabric的一个分支。但Quilt有一些与Fabric的关键区别。 -TODO: Levi write your thing here +TODO: Levi,把你的东西写在这里 diff --git a/wiki/introduction/setting-up/zh_cn.md b/wiki/introduction/setting-up/zh_cn.md new file mode 100644 index 00000000..a43a56a2 --- /dev/null +++ b/wiki/introduction/setting-up/zh_cn.md @@ -0,0 +1,209 @@ +# 建立开发环境 + +在开始之前,你需要准备以下东西。 + +- Java 17(推荐)或更新版本的Java开发工具包(JDK)。 + Temurin Adoptium JDK 很容易获得并推荐使用。 + 你可以在这里下载它: +- 任何Java IDE,如[IntelliJ Idea](https://www.jetbrains.com/zh-cn/idea/)和[Eclipse](https://www.eclipse.org/ide/). + [Visual Studio Code](https://code.visualstudio.com/)可以工作, 但需要额外的操作来设置。 +- 我们建议使用IntelliJ IDEA,因为它集成的功能多且容易使用。 + +接下来,你需要决定是[下载模板模组压缩包](#template-mod-download-zip-file)还是[使用GitHub模板](#template-mod-download-github-template)。如果你不知道如何使用Git,请使用第一种方法。但还是建议你拥有一个GitHub帐户,以便快速入门并熟悉Git。 + +## 模板模组下载 (压缩包) + +你可以从[quilt-template-mod](https://github.com/QuiltMC/quilt-template-mod)仓库中下载模板模组。 + +要下载模板mod的ZIP文件,请打开[GitHub 仓库](https://github.com/QuiltMC/quilt-template-mod), +然后点击到`< > Code`按钮并选择`Download ZIP`,如下图所示: + + + + The GitHub repository with an arrow pointing to the code button, and another to the Download ZIP button inside the opened popup + + +然后,提取ZIP文件的内容到你选择的文件夹中。 + +## 模板模组下载 (GitHub模板) + +要使用[GitHub模板](https://github.com/QuiltMC/quilt-template-mod),请访问[GitHub仓库](https://github.com/QuiltMC/quilt-template-mod),然后点击`Use this template`按钮。按照对话框进行操作,然后使用Git克隆该存储库。做完这一切后,你可以继续了。 + +## 使用IntelliJ IDEA建立开发环境 + +现在你需要设置开发环境。打开IntelliJ IDEA,按照初始设置对话框进行操作。 +然后,你需要打开项目: + +If you downloaded the template mod and extracted it into a folder, +import the project by pressing the `Open` button in the project listing. + +If you made a GitHub repository with the template, use the `Get from VCS` button. + + + + IntelliJ IDEA projects window + + +If you get a window asking if you trust the folder, press `Trust Project`. + +There is a plugin that adds additional support for Minecraft modding projects +that is highly recommended. You can get it here: + + +## An Overview Over IDEA + +After you opened the project, you should see a window looking roughly like this: + +TODO: Embed screenshot + +On the right and left side there are sidebars with icons to toggle different "Tool Windows". There are a few that you should know about: First, the folder icon in the top left toggles your `Project` tool window. With it, you can select the different files in your project. In the bottom left, there are the buttons for the `Terminal` and `Version Control System`. Additionally, after you tested your mod, there should also be a `Run` and a `Build` button. To the right are the `Notifications` and `Gradle` tool windows. + +When you open a file, it should open a new tab in the editor in the middle. +Additionally, there are some things you might find not straight away: If you want to rename something, be it a file or a name of a variable or function, you can do so in the context menu under `Refactor > Rename` + +## Making the Mod Yours + +First you'll need to make up a name for your mod. For this tutorial, we will use the mod name `Bingus Mod`. + +Based on the name, you also need a mod id. It should be composed of lowercase characters from the alphabet and underlines. Usually, you mod id should be your mod name, but with underscores instead of spaces, hyphens or other special characters. Additionally, there shouldn't be a mod already using that id. For a mod named `Bingus Mod`, it would be `bingus_mod`. + +Lastly you need to decide on a maven group. It is used to identify the developer of the mod in a machine-readable scheme and is designed to be unique. It should be a domain you own in reversed. So if you own `bingus.example.com`, your maven group would be `com.example.bingus`. If you don't have a domain (or don't know what it is), but have a GitHub account, you can use `io.github.your_github_username`, replace all special characters with underscores again. + +--- + +Now that you have decided on these things, you can update your mod's metadata: + +First, update the `gradle.properties` file directly in your project folder to use your Maven group and mod ID. + +Change the line beginning with `maven_group =` to use your mod maven group instead of `com.example` +Set `archives_base_name` to your mod's ID similarly and ignore all other properties for now. Here is an example how the result might look: + +```gradle +# Gradle Properties +org.gradle.jwmargs = -Xmx1G +org.gradle.parallel = true + +# Mod Properties +version = 1.0.0 +maven_group = io.github.bingus +archives_base_name = bingus-mod +``` + +--- + +Next, update the `quilt.mod.json` file in the `src/main/resources` folder. The `quilt.mod.json` defines your mod's metadata, like mod name, author, description, website, but also more development focused metadata such as dependencies, version, mod ID and [mod initializers](../concepts/sideness#on-mod-initializers). + +You'll need to update a few things under `"quilt_loader"`, see below for a finalized example: + +1. `"group"` should be set to the Maven group you specified in your `gradle.properties`. +2. `"id"` should be set to your mod's ID. This should be your mod's name in all lowercase + with underscores instead of spaces. +3. `"metadata"`: + 1. `"name"` should be your mod's name. This does not require any special formatting, + unlike your mod's ID. + 2. `"description"` should be a short description of your mod. + 3. `"contributors"` can contain entries for anything. Use your name as the key + and `"Developer"` as the value if you don't know what to put here. + 4. `"contact"` can contain entries for anything similar to `""contributors"`, + but typically people put a `"homepage"`, a `"sources"`, and a `"issues"` entry with a valid URL here. + 5. Replace `example_mod` with your mod's ID in `"icon"`. +4. In `"entrypoints"`, replace `com.example.example_mod` with your Maven group and mod ID, + and the `ExampleMod` at the end should be the Java class name for your mod. The Java class name usually is your mod's name, written in `UpperCamelCase` (So new words simply start by using a uppercase letter and the initial latter is also upper case) + For example, `io.github.bingus.bingus_mod.BingusMod`. +5. In `"mixin"`, replace `example_mod` in the file name to your mod's ID. + +Your `quilt.mod.json` should not have any traces of "example" in them anymore. + +```json +{ + "schema_version": 1, + "quilt_loader": { + "group": "io.github.bingus", + "id": "bingus_mod", + "version": "${version}", + "metadata": { + "name": "Bingus Mod", + "description": "This mod adds Bingus to Minecraft!", + "contributors": { + "Bingus": "Developer" + }, + "contact": { + "homepage": "https://example.org" + }, + "icon": "assets/bingus_mod/icon.png" + }, + "intermediate_mappings": "net.fabricmc:intermediary", + "entrypoints": { + "init": "io.github.bingus.bingus_mod.BingusMod" + }, + "depends": [ + // ... + ] + }, + "mixin": "bingus_mod.mixins.json" +} +``` + +--- + +Create a `LICENSE` for your mod. If you don't know which license to use, check out this +link: . Note that GPL-3.0 and AGPL-3.0 are both incompatible +with Minecraft, so don't use them. Once you've chosen a license, put the license's plain text +in a file named exactly `LICENSE`. + +Delete the `LICENSE-TEMPLATE.md` file. It's not necessary to have since it's the license for +the template, not your mod. + +--- + +Change the name of the directories in the `src/main/java` folder to reflect your mod. +For example, if your Maven group is `io.github.bingus` and your mod's ID is `bingus_mod`, +you should have four directories in total. IntelliJ IDEA should make this step easier for +you when you rename the directories; just change the whole line to match your group and ID. + + + + IntelliJ IDEA rename packages dialog + + +Delete the `com.example` directories. + +Rename `ExampleMod` to your mod's name using Java class naming conventions. Check that the +`package` declaration at the top is correct! + +In the `resources` folder, change `example_mod.mixins.json` to the file name you set in +`quilt.mod.json`. Change the name of the folder inside `assets` to be your mod's ID. + +Your directories and file names should not have any traces of "example" in them anymore. + + + + Directory structure + + +--- + +If the versions in `gradle/libs.versions.toml` are out of date, replace the old version +number with the new ones obtained from this link: + +--- + +We're almost done! The last step is to generate the Minecraft sources with Vineflower. +This is so you can view Minecraft's code with the power of Quilt's decompiler. +In the Gradle menu, go to the `fabric` category and run the `genSourcesWithVineflower` +task. + + + + Gradle window with genSourcesWithVineflower highlighted + + +Finally, reload the Gradle project by pressing this button in the Gradle menu: + + + + Gradle window with the 'reload project' button highlighted + + +Once you're done with all of these steps, your mod is ready to be worked on! +You can start by [Creating your First Item](../items/first-item) From 424642772a50693cc87a8dcca9786db9e839ac4e Mon Sep 17 00:00:00 2001 From: Ginsway Date: Wed, 24 Jan 2024 19:15:56 +0800 Subject: [PATCH 3/8] update id --- src/lib/translations/index.ts | 14 +++++++------- src/lib/translations/lang.js | 2 +- .../translations/{zh_cn => zh}/application.json | 2 +- src/lib/translations/{zh_cn => zh}/error.json | 0 src/lib/translations/{zh_cn => zh}/wiki.json | 0 wiki/introduction/get-started/{zh_cn.md => zh.md} | 0 wiki/introduction/setting-up/{zh_cn.md => zh.md} | 14 +++++++------- 7 files changed, 16 insertions(+), 16 deletions(-) rename src/lib/translations/{zh_cn => zh}/application.json (66%) rename src/lib/translations/{zh_cn => zh}/error.json (100%) rename src/lib/translations/{zh_cn => zh}/wiki.json (100%) rename wiki/introduction/get-started/{zh_cn.md => zh.md} (100%) rename wiki/introduction/setting-up/{zh_cn.md => zh.md} (88%) diff --git a/src/lib/translations/index.ts b/src/lib/translations/index.ts index 8c55a18b..4ae98052 100644 --- a/src/lib/translations/index.ts +++ b/src/lib/translations/index.ts @@ -16,7 +16,7 @@ export const config: Config<{ placeholder?: string }> = { translations: { en: { lang }, fr: { lang }, - zh_cn: { lang } + zh: { lang } }, loaders: [ { @@ -50,19 +50,19 @@ export const config: Config<{ placeholder?: string }> = { loader: async () => (await import("./fr/wiki.json")).default }, { - locale: "zh_cn", + locale: "zh", key: "application", - loader: async () => (await import("./zh_cn/application.json")).default + loader: async () => (await import("./zh/application.json")).default }, { - locale: "zh_cn", + locale: "zh", key: "error", - loader: async () => (await import("./zh_cn/error.json")).default + loader: async () => (await import("./zh/error.json")).default }, { - locale: "zh_cn", + locale: "zh", key: "wiki", - loader: async () => (await import("./zh_cn/wiki.json")).default + loader: async () => (await import("./zh/wiki.json")).default } ], log: { level: dev ? "warn" : "error" } diff --git a/src/lib/translations/lang.js b/src/lib/translations/lang.js index 16f67ccb..d17d651c 100644 --- a/src/lib/translations/lang.js +++ b/src/lib/translations/lang.js @@ -1,5 +1,5 @@ export default { en: "English", fr: "Français", - zh_cn: "简体中文" + zh: "中文" }; diff --git a/src/lib/translations/zh_cn/application.json b/src/lib/translations/zh/application.json similarity index 66% rename from src/lib/translations/zh_cn/application.json rename to src/lib/translations/zh/application.json index d6dac96b..4c19bfa6 100644 --- a/src/lib/translations/zh_cn/application.json +++ b/src/lib/translations/zh/application.json @@ -2,7 +2,7 @@ "title": "Quilt开发Wiki :P", "dev-notice": "注意:本网站仍在开发中。请在<{{placeholder}}>中报告发现的问题", "translation-notice": "请注意,此wiki的原始语言为英语,翻译版本可能与英语版本不同步", - "draft-notice": "You were linked to a page in the wiki that is planned, but not yet implemented. If you want to help building out this wiki, go and take a look at <{{placeholder}}>", + "draft-notice": "你已访问到Wiki中已计划但尚未实现的页面。如果你想帮助编写此页面,请访问<{{placeholder}}>", "sidebar": { "menu": "菜单", "articles": "文章" diff --git a/src/lib/translations/zh_cn/error.json b/src/lib/translations/zh/error.json similarity index 100% rename from src/lib/translations/zh_cn/error.json rename to src/lib/translations/zh/error.json diff --git a/src/lib/translations/zh_cn/wiki.json b/src/lib/translations/zh/wiki.json similarity index 100% rename from src/lib/translations/zh_cn/wiki.json rename to src/lib/translations/zh/wiki.json diff --git a/wiki/introduction/get-started/zh_cn.md b/wiki/introduction/get-started/zh.md similarity index 100% rename from wiki/introduction/get-started/zh_cn.md rename to wiki/introduction/get-started/zh.md diff --git a/wiki/introduction/setting-up/zh_cn.md b/wiki/introduction/setting-up/zh.md similarity index 88% rename from wiki/introduction/setting-up/zh_cn.md rename to wiki/introduction/setting-up/zh.md index a43a56a2..b9812679 100644 --- a/wiki/introduction/setting-up/zh_cn.md +++ b/wiki/introduction/setting-up/zh.md @@ -63,27 +63,27 @@ Additionally, there are some things you might find not straight away: If you wan ## Making the Mod Yours -First you'll need to make up a name for your mod. For this tutorial, we will use the mod name `Bingus Mod`. +首先,你需要为你的模组取一个名字。在本教程中,我们将使用`Bingus Mod`这个模组名。 -Based on the name, you also need a mod id. It should be composed of lowercase characters from the alphabet and underlines. Usually, you mod id should be your mod name, but with underscores instead of spaces, hyphens or other special characters. Additionally, there shouldn't be a mod already using that id. For a mod named `Bingus Mod`, it would be `bingus_mod`. +根据名字,你还需要一个MODID,它由小写字母和下划线组成。通常情况下,你的MODID应该是你的模组名字,但用下划线代替空格、连接字符或其他特殊字符。此外,此MODID不能与其他模组重复。比如名为`Bingus Mod`的模组,它的MODID应是`bingus_mod`。 -Lastly you need to decide on a maven group. It is used to identify the developer of the mod in a machine-readable scheme and is designed to be unique. It should be a domain you own in reversed. So if you own `bingus.example.com`, your maven group would be `com.example.bingus`. If you don't have a domain (or don't know what it is), but have a GitHub account, you can use `io.github.your_github_username`, replace all special characters with underscores again. +最后,你需要决定你的maven group。它用于在机器可读的方案中识别mod的开发者,且被设计为唯一的。它应该是你拥有的域名颠倒过来。因此,如果你拥有`bingus.example.com`,你的maven group将是`com.example.bingus`。如果你没有域名(或者不知道它是什么),但有一个GitHub帐户,你可以使用`io.github.your_github_username`,再用下划线替换所有特殊字符。 --- -Now that you have decided on these things, you can update your mod's metadata: +现在你已经决定了这些事情,你可以更新你的模组元数据: -First, update the `gradle.properties` file directly in your project folder to use your Maven group and mod ID. +首先,直接更新在项目文件夹中的`gradle.properties`中的Maven group和MODID。 Change the line beginning with `maven_group =` to use your mod maven group instead of `com.example` Set `archives_base_name` to your mod's ID similarly and ignore all other properties for now. Here is an example how the result might look: ```gradle -# Gradle Properties +# Gradle属性 org.gradle.jwmargs = -Xmx1G org.gradle.parallel = true -# Mod Properties +# 模组属性 version = 1.0.0 maven_group = io.github.bingus archives_base_name = bingus-mod From 9255d9710e9741592a6a4468009b0bd5235e226a Mon Sep 17 00:00:00 2001 From: Ginsway Date: Wed, 24 Jan 2024 19:32:34 +0800 Subject: [PATCH 4/8] fix-link --- wiki/introduction/setting-up/zh.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wiki/introduction/setting-up/zh.md b/wiki/introduction/setting-up/zh.md index b9812679..7eaef2a6 100644 --- a/wiki/introduction/setting-up/zh.md +++ b/wiki/introduction/setting-up/zh.md @@ -9,9 +9,9 @@ [Visual Studio Code](https://code.visualstudio.com/)可以工作, 但需要额外的操作来设置。 - 我们建议使用IntelliJ IDEA,因为它集成的功能多且容易使用。 -接下来,你需要决定是[下载模板模组压缩包](#template-mod-download-zip-file)还是[使用GitHub模板](#template-mod-download-github-template)。如果你不知道如何使用Git,请使用第一种方法。但还是建议你拥有一个GitHub帐户,以便快速入门并熟悉Git。 +接下来,你需要决定是[下载模板模组压缩包](#模板模组下载压缩包)还是[使用GitHub模板](#模板模组下载GitHub模板)。如果你不知道如何使用Git,请使用第一种方法。但还是建议你拥有一个GitHub帐户,以便快速入门并熟悉Git。 -## 模板模组下载 (压缩包) +## 模板模组下载(压缩包) 你可以从[quilt-template-mod](https://github.com/QuiltMC/quilt-template-mod)仓库中下载模板模组。 @@ -25,7 +25,7 @@ 然后,提取ZIP文件的内容到你选择的文件夹中。 -## 模板模组下载 (GitHub模板) +## 模板模组下载(GitHub模板) 要使用[GitHub模板](https://github.com/QuiltMC/quilt-template-mod),请访问[GitHub仓库](https://github.com/QuiltMC/quilt-template-mod),然后点击`Use this template`按钮。按照对话框进行操作,然后使用Git克隆该存储库。做完这一切后,你可以继续了。 From ba1eb4fab9119c20ea4e29656a6509a9b38c2538 Mon Sep 17 00:00:00 2001 From: Ginsway Date: Sat, 3 Feb 2024 13:19:21 +0800 Subject: [PATCH 5/8] Update zh.md --- wiki/introduction/setting-up/zh.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wiki/introduction/setting-up/zh.md b/wiki/introduction/setting-up/zh.md index 7eaef2a6..e176e68a 100644 --- a/wiki/introduction/setting-up/zh.md +++ b/wiki/introduction/setting-up/zh.md @@ -61,7 +61,7 @@ On the right and left side there are sidebars with icons to toggle different "To When you open a file, it should open a new tab in the editor in the middle. Additionally, there are some things you might find not straight away: If you want to rename something, be it a file or a name of a variable or function, you can do so in the context menu under `Refactor > Rename` -## Making the Mod Yours +## 让模组成为你的 首先,你需要为你的模组取一个名字。在本教程中,我们将使用`Bingus Mod`这个模组名。 @@ -75,8 +75,8 @@ Additionally, there are some things you might find not straight away: If you wan 首先,直接更新在项目文件夹中的`gradle.properties`中的Maven group和MODID。 -Change the line beginning with `maven_group =` to use your mod maven group instead of `com.example` -Set `archives_base_name` to your mod's ID similarly and ignore all other properties for now. Here is an example how the result might look: +将以`maven_group =`开头的行更改为使用你模组的maven group,而不是`com.example`。 +类似地,将`archives_base_name`设置为你的MODID,暂时忽略所有其他属性。这里是结果的示例: ```gradle # Gradle属性 @@ -91,7 +91,7 @@ archives_base_name = bingus-mod --- -Next, update the `quilt.mod.json` file in the `src/main/resources` folder. The `quilt.mod.json` defines your mod's metadata, like mod name, author, description, website, but also more development focused metadata such as dependencies, version, mod ID and [mod initializers](../concepts/sideness#on-mod-initializers). +接下来,更新在`src/main/resources`文件夹中的`quilt.mod.json`文件。The `quilt.mod.json` defines your mod's metadata, like mod name, author, description, website, but also more development focused metadata such as dependencies, version, mod ID and [mod initializers](../concepts/sideness#on-mod-initializers). You'll need to update a few things under `"quilt_loader"`, see below for a finalized example: @@ -137,7 +137,7 @@ Your `quilt.mod.json` should not have any traces of "example" in them anymore. "init": "io.github.bingus.bingus_mod.BingusMod" }, "depends": [ - // ... + // …… ] }, "mixin": "bingus_mod.mixins.json" From f72a7476cc78e580025d1a3604f68d4f8d3639ea Mon Sep 17 00:00:00 2001 From: Ginsway Date: Fri, 12 Jul 2024 21:31:17 +0800 Subject: [PATCH 6/8] Update zh.md --- wiki/introduction/setting-up/zh.md | 41 +++++++++++++----------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/wiki/introduction/setting-up/zh.md b/wiki/introduction/setting-up/zh.md index e176e68a..00b9855f 100644 --- a/wiki/introduction/setting-up/zh.md +++ b/wiki/introduction/setting-up/zh.md @@ -61,7 +61,7 @@ On the right and left side there are sidebars with icons to toggle different "To When you open a file, it should open a new tab in the editor in the middle. Additionally, there are some things you might find not straight away: If you want to rename something, be it a file or a name of a variable or function, you can do so in the context menu under `Refactor > Rename` -## 让模组成为你的 +## 定制你的模组 首先,你需要为你的模组取一个名字。在本教程中,我们将使用`Bingus Mod`这个模组名。 @@ -91,28 +91,23 @@ archives_base_name = bingus-mod --- -接下来,更新在`src/main/resources`文件夹中的`quilt.mod.json`文件。The `quilt.mod.json` defines your mod's metadata, like mod name, author, description, website, but also more development focused metadata such as dependencies, version, mod ID and [mod initializers](../concepts/sideness#on-mod-initializers). - -You'll need to update a few things under `"quilt_loader"`, see below for a finalized example: - -1. `"group"` should be set to the Maven group you specified in your `gradle.properties`. -2. `"id"` should be set to your mod's ID. This should be your mod's name in all lowercase - with underscores instead of spaces. -3. `"metadata"`: - 1. `"name"` should be your mod's name. This does not require any special formatting, - unlike your mod's ID. - 2. `"description"` should be a short description of your mod. - 3. `"contributors"` can contain entries for anything. Use your name as the key - and `"Developer"` as the value if you don't know what to put here. - 4. `"contact"` can contain entries for anything similar to `""contributors"`, - but typically people put a `"homepage"`, a `"sources"`, and a `"issues"` entry with a valid URL here. - 5. Replace `example_mod` with your mod's ID in `"icon"`. -4. In `"entrypoints"`, replace `com.example.example_mod` with your Maven group and mod ID, - and the `ExampleMod` at the end should be the Java class name for your mod. The Java class name usually is your mod's name, written in `UpperCamelCase` (So new words simply start by using a uppercase letter and the initial latter is also upper case) - For example, `io.github.bingus.bingus_mod.BingusMod`. -5. In `"mixin"`, replace `example_mod` in the file name to your mod's ID. - -Your `quilt.mod.json` should not have any traces of "example" in them anymore. +接下来,更新在`src/main/resources`文件夹中的`quilt.mod.json`文件。 +`quilt.mod.json` 定义了你的模组的元数据,如模组名称、模组作者、模组描述和官方网站。还定义了开发相关的元数据,如依赖项、版本、MODID和[mod initializers](../concepts/sideness#on-mod-initializers)。 + +你需要在 `"quilt_loader"` 下更新一些内容: + +1. `"group"` 应设置为你在 `gradle.properties` 中指定的 Maven group。 +2. `"id"` 应设置为你的MODID。这里应该是模组名称的小写形式,且用下划线代替空格。 +3. `"metadata"`: + 1. `"name"` 应为你模组的名称。与MODID不同,这里不需要特殊格式。 + 2. `"description"` 应为你模组的简短描述。 + 3. `"contributors"` 可以包含任何条目。如果不知道要放什么,可以将你的名字作为键,值设为 `"Developer"`。 + 4. `"contact"` 可以包含与 `"contributors"` 类似的条目,通常包括 `"homepage"`、`"sources"` 和 `"issues"` 条目,其中的值为有效的URL。 + 5. 在 `"icon"` 中用你的MODID替换 `example_mod`。 +4. 在 `"entrypoints"` 中,用你的 Maven group 和MODID替换 `com.example.example_mod`,末尾的 `ExampleMod` 应为你模组的Java类名。Java类名通常使用 `UpperCamelCase`,例如 `io.github.bingus.bingus_mod.BingusMod`。 +5. 在 `"mixin"` 中,用你的MODID替换文件名中的 `example_mod`。 + +修改后你的 `quilt.mod.json` 中不应出现 “example” 这个单词,详见下面的最终示例: ```json { From 3b20452dc5a27809bb4e02d0b91dcf63be3bb6c8 Mon Sep 17 00:00:00 2001 From: Ginsway Date: Sat, 24 Aug 2024 14:52:12 +0800 Subject: [PATCH 7/8] Update zh.md --- wiki/introduction/setting-up/zh.md | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/wiki/introduction/setting-up/zh.md b/wiki/introduction/setting-up/zh.md index 00b9855f..ff148fb3 100644 --- a/wiki/introduction/setting-up/zh.md +++ b/wiki/introduction/setting-up/zh.md @@ -3,10 +3,10 @@ 在开始之前,你需要准备以下东西。 - Java 17(推荐)或更新版本的Java开发工具包(JDK)。 - Temurin Adoptium JDK 很容易获得并推荐使用。 + Temurin Adoptium JDK 易于使用。 你可以在这里下载它: -- 任何Java IDE,如[IntelliJ Idea](https://www.jetbrains.com/zh-cn/idea/)和[Eclipse](https://www.eclipse.org/ide/). - [Visual Studio Code](https://code.visualstudio.com/)可以工作, 但需要额外的操作来设置。 +- 任何Java IDE,如 [IntelliJ Idea](https://www.jetbrains.com/zh-cn/idea/) 和 [Eclipse](https://www.eclipse.org/ide/)。 + [Visual Studio Code](https://code.visualstudio.com/) 可以工作, 但需要设置的操作更繁琐。 - 我们建议使用IntelliJ IDEA,因为它集成的功能多且容易使用。 接下来,你需要决定是[下载模板模组压缩包](#模板模组下载压缩包)还是[使用GitHub模板](#模板模组下载GitHub模板)。如果你不知道如何使用Git,请使用第一种方法。但还是建议你拥有一个GitHub帐户,以便快速入门并熟悉Git。 @@ -141,20 +141,13 @@ archives_base_name = bingus-mod --- -Create a `LICENSE` for your mod. If you don't know which license to use, check out this -link: . Note that GPL-3.0 and AGPL-3.0 are both incompatible -with Minecraft, so don't use them. Once you've chosen a license, put the license's plain text -in a file named exactly `LICENSE`. +为你的模组创建一个 `LICENSE` 文件。如果你不确定使用哪个开源协议,可在此链接查看主流开源协议的详细介绍:。请注意,GPL-3.0 和 AGPL-3.0 与 Minecraft 不兼容,不要使用这两种开源协议。选择好后,需要该开源协议的纯文本内容放入名为 `LICENSE` 的文件中。 -Delete the `LICENSE-TEMPLATE.md` file. It's not necessary to have since it's the license for -the template, not your mod. +删除 `LICENSE-TEMPLATE.md` 文件。因为这是模板的开源协议,而不是你模组的开源协议。 --- -Change the name of the directories in the `src/main/java` folder to reflect your mod. -For example, if your Maven group is `io.github.bingus` and your mod's ID is `bingus_mod`, -you should have four directories in total. IntelliJ IDEA should make this step easier for -you when you rename the directories; just change the whole line to match your group and ID. +将 `src/main/java` 文件夹中的目录名称更改的与你的模组相符。例如,如果你的 Maven Gruop 是 `io.github.bingus` 且 MODID 是 `bingus_mod`,那么你应该总共有四个目录。IntelliJ IDEA 在重命名这些目录时会更简单:将整行名称更改为与你的 Maven Gruop 和 MODID 匹配的名称即可。 From 8936b2aa37febaabcfc8a6b6100e33345b142f8a Mon Sep 17 00:00:00 2001 From: Ginsway Date: Sat, 15 Mar 2025 18:15:16 +0800 Subject: [PATCH 8/8] Update zh.md --- wiki/introduction/setting-up/zh.md | 45 +++++++++++++++++++----------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/wiki/introduction/setting-up/zh.md b/wiki/introduction/setting-up/zh.md index ff148fb3..9e932079 100644 --- a/wiki/introduction/setting-up/zh.md +++ b/wiki/introduction/setting-up/zh.md @@ -9,13 +9,13 @@ [Visual Studio Code](https://code.visualstudio.com/) 可以工作, 但需要设置的操作更繁琐。 - 我们建议使用IntelliJ IDEA,因为它集成的功能多且容易使用。 -接下来,你需要决定是[下载模板模组压缩包](#模板模组下载压缩包)还是[使用GitHub模板](#模板模组下载GitHub模板)。如果你不知道如何使用Git,请使用第一种方法。但还是建议你拥有一个GitHub帐户,以便快速入门并熟悉Git。 +接下来,你需要[下载模组模板压缩包](#模组模板下载压缩包)或者[使用GitHub模板](#模组模板下载GitHub模板)。如果你不知道如何使用Git,请使用第一种方法。但还是建议你拥有一个GitHub帐户,以便快速入门并熟悉Git。 -## 模板模组下载(压缩包) +## 模组模板下载(压缩包) -你可以从[quilt-template-mod](https://github.com/QuiltMC/quilt-template-mod)仓库中下载模板模组。 +你可以从[quilt-template-mod](https://github.com/QuiltMC/quilt-template-mod)仓库中下载模组模板。 -要下载模板mod的ZIP文件,请打开[GitHub 仓库](https://github.com/QuiltMC/quilt-template-mod), +请打开[GitHub 仓库](https://github.com/QuiltMC/quilt-template-mod)下载模组模板的压缩包, 然后点击到`< > Code`按钮并选择`Download ZIP`,如下图所示: @@ -23,9 +23,9 @@ The GitHub repository with an arrow pointing to the code button, and another to the Download ZIP button inside the opened popup -然后,提取ZIP文件的内容到你选择的文件夹中。 +然后,解压压缩包到你选择的文件夹中。 -## 模板模组下载(GitHub模板) +## 模组模板下载(GitHub模板) 要使用[GitHub模板](https://github.com/QuiltMC/quilt-template-mod),请访问[GitHub仓库](https://github.com/QuiltMC/quilt-template-mod),然后点击`Use this template`按钮。按照对话框进行操作,然后使用Git克隆该存储库。做完这一切后,你可以继续了。 @@ -34,20 +34,20 @@ 现在你需要设置开发环境。打开IntelliJ IDEA,按照初始设置对话框进行操作。 然后,你需要打开项目: -If you downloaded the template mod and extracted it into a folder, -import the project by pressing the `Open` button in the project listing. +如果你下载了模板模块并将其解压到一个文件夹中, +可以通过点击项目列表中的 `打开`按钮来导入项目。 -If you made a GitHub repository with the template, use the `Get from VCS` button. +如果你使用模板创建了一个 GitHub 仓库,请使用 `克隆存储库`按钮。 - - - IntelliJ IDEA projects window + + + IntelliJ IDEA 项目窗口 -If you get a window asking if you trust the folder, press `Trust Project`. +如果你看到一个询问是否信任该文件夹的窗口,请点击 `Trust Project`(信任项目)。 -There is a plugin that adds additional support for Minecraft modding projects -that is highly recommended. You can get it here: +有一个插件可以为 Minecraft 模组开发项目提供额外的支持,强烈推荐安装。 +你可以通过以下链接获取: ## An Overview Over IDEA @@ -61,7 +61,18 @@ On the right and left side there are sidebars with icons to toggle different "To When you open a file, it should open a new tab in the editor in the middle. Additionally, there are some things you might find not straight away: If you want to rename something, be it a file or a name of a variable or function, you can do so in the context menu under `Refactor > Rename` -## 定制你的模组 +## IDEA 概览 + +当你打开项目后,你应该会看到一个大致如下的窗口: + +待办:嵌入截图 + +在窗口的左右两侧有侧边栏,上面有图标用于切换不同的“工具窗口”。其中有几个是你应该了解的:首先,左上角的文件夹图标用于切换你的 `项目`工具窗口。你可以通过它选择项目中的不同文件。在左下角,有 `终端`和 `Version Control System`(版本控制系统)的按钮。此在你测试完你的模块后,还会出现 `Run`(运行)和 `Build`(构建)按钮。在右侧是 `通知`和 `Gradle` 工具窗口。 + +当你打开一个文件时,它会在中间的编辑器中打开一个新标签页。 +此外,还有一些你可能不会立刻发现的功能:如果你想重命名某些内容,无论是文件、变量名还是函数名,你都可以在右键菜单中的 `重构 > 重命名`进行操作。 + +## 填写模组信息 首先,你需要为你的模组取一个名字。在本教程中,我们将使用`Bingus Mod`这个模组名。 @@ -79,7 +90,7 @@ Additionally, there are some things you might find not straight away: If you wan 类似地,将`archives_base_name`设置为你的MODID,暂时忽略所有其他属性。这里是结果的示例: ```gradle -# Gradle属性 +# Gradle 属性 org.gradle.jwmargs = -Xmx1G org.gradle.parallel = true