zh_cn:tutorial:shield
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
zh_cn:tutorial:shield [2021/10/05 02:20] – hanbings | zh_cn:tutorial:shield [2023/08/21 07:33] (current) – [添加盾牌[最高支持到1.19版本,对于1.14及以下版本,请参考英文原版wiki:https://fabricmc.net/wiki/tutorial:shield]] wjz_p | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== 添加盾牌 ====== | + | ====== 添加盾牌====== |
+ | [最高支持到1.19版本,对于1.14及以下版本,请参考英文原版wiki: | ||
恭喜!在上一个教程中我们学会了如何创建自定义工具!想象一下,如果想要防御一把十分强大自定义的剑,常规的盾牌是不大起作用的。因此,我们将在这里尝试创建自定义的盾牌。 | 恭喜!在上一个教程中我们学会了如何创建自定义工具!想象一下,如果想要防御一把十分强大自定义的剑,常规的盾牌是不大起作用的。因此,我们将在这里尝试创建自定义的盾牌。 | ||
Line 11: | Line 12: | ||
**gradle.properties**\\ | **gradle.properties**\\ | ||
<code java> | <code java> | ||
- | fabric_shield_lib_version=1.3.7 | + | fabric_shield_lib_version=1.6.0-1.19 |
</ | </ | ||
**build.gradle** (在 dependencies {} 下)\\ | **build.gradle** (在 dependencies {} 下)\\ | ||
<code java> | <code java> | ||
- | modImplementation " | + | modImplementation " |
</ | </ | ||
在编写本文时,最新 project.fabric_shield_lib_version 应为1.3.7,最新 project.minecraft_version 应为1.17.1。每当出现新的版本时,此页面都会更新。\\ \\ | 在编写本文时,最新 project.fabric_shield_lib_version 应为1.3.7,最新 project.minecraft_version 应为1.17.1。每当出现新的版本时,此页面都会更新。\\ \\ | ||
**build.gradle** (在 repositories {} 下)\\ | **build.gradle** (在 repositories {} 下)\\ | ||
<code java> | <code java> | ||
- | allprojects { repositories { maven { url ' | + | maven { url = ' |
</ | </ | ||
+ | |||
+ | |||
+ | **__如果你的mod用于1.17或更高的游戏版本、或者你正在使用FabricShieldLib version 1.5.0 或以上,记得同时也要添加下面的东西:__** | ||
+ | |||
+ | **gradle.properties**\\ | ||
+ | <code java> | ||
+ | fabric_asm_version=2.3 | ||
+ | cloth_version=8.1.77 | ||
+ | mod_menu_version=4.0.6 | ||
+ | crowdlin_version=1.4+1.19 | ||
+ | </ | ||
+ | |||
+ | **(These versions will be updated in this wiki alongside the mod version)** | ||
+ | |||
+ | **build.gradle** (under dependencies)\\ | ||
+ | <code java> | ||
+ | |||
+ | modApi(" | ||
+ | exclude(group: | ||
+ | } | ||
+ | include(" | ||
+ | |||
+ | modCompileOnly modRuntimeOnly (" | ||
+ | exclude(group: | ||
+ | } | ||
+ | |||
+ | modImplementation(" | ||
+ | exclude (group: " | ||
+ | } | ||
+ | include(" | ||
+ | |||
+ | </ | ||
+ | |||
+ | **build.gradle** (under repositories, | ||
+ | <code java> | ||
+ | maven { url " | ||
+ | maven { url " | ||
+ | </ | ||
+ | |||
+ | |||
===== 添加一块自定义的盾牌 ===== | ===== 添加一块自定义的盾牌 ===== | ||
Line 32: | Line 73: | ||
然后,注册这个物品\\ | 然后,注册这个物品\\ | ||
<code java> | <code java> | ||
- | Registry.register(Registry.ITEM, new Identifier(" | + | Registry.register(Registries.ITEM, new Identifier(" |
</ | </ | ||
我们已经创建了自定义盾牌的物品\\ | 我们已经创建了自定义盾牌的物品\\ |
zh_cn/tutorial/shield.1633400452.txt.gz · Last modified: 2021/10/05 02:20 by hanbings