User Tools

Site Tools


zh_cn:tutorial:armor

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:armor [2021/07/25 01:14] – created solidblockzh_cn:tutorial:armor [2022/08/10 01:40] – [添加击退保护] xtexchooser
Line 3: Line 3:
 ==== 介绍 ==== ==== 介绍 ====
  
-盔甲是比一般的方块或者物品更复杂一点的实现,但是只要了解了,实现还是很简单的。如需添加盔甲,需要先做一个CustomArmorMaterial类,然后注册物品。无门还需要看看如何为盔甲提供材质There's a special chapter at the end of this document that explains how to add knockback to the armor, since the method is only accessible through a mixin (as of 1.16.3).+盔甲是比一般的方块或者物品更复杂一点的实现,但是只要了解了,实现还是很简单的。如需添加盔甲,需要先实现CustomArmorMaterial类,然后注册物品。我们还需要看看如何为盔甲提供纹理本文最后有一个解释如何添加击退的特殊章节,因为此方法只能通过Mixin访问(对于1.16.3)。
  
-本文档的一个例子可以在[[https://github.com/CumulusMC/Gilded-Netherite|本模组GitHub仓库]]找到。 +本文档的一个例子可以在[[https://github.com/gdude2002/Gilded-Netherite|本模组GitHub仓库]]找到。 
  
 ==== 创建盔甲材料类 ==== ==== 创建盔甲材料类 ====
Line 137: Line 137:
 </code> </code>
  
-好了!你的盔甲现在应该存在于游戏中,虽然还没有材质,但是已经可以通过/give来获得了。+好了!你的盔甲现在应该存在于游戏中,虽然还没有纹理,但是已经可以通过/give来获得了。
  
-现在分配材质+现在分配纹理
  
  
  
-==== 提供材质 ====+==== 提供纹理 ====
  
 假定你已经: 假定你已经:
-  * 有了每一个盔甲物品的材质(x_helmet.png、x_chestplate.png等) +  * 有了每一个盔甲物品的纹理(x_helmet.png、x_chestplate.png等) 
-  * 有了穿着的每个盔甲的材质(x_layer_1.png和x_layer_2.png)+  * 有了穿着的每个盔甲的纹理(x_layer_1.png和x_layer_2.png)
  
 将其分配到每一个盔甲物品。 将其分配到每一个盔甲物品。
Line 164: Line 164:
 重复上述过程,完成其他物品。 重复上述过程,完成其他物品。
  
-要给予穿着的盔甲的材质,只需要将X_layer_1.png和X_layer_2.png(其中X是你在你的盔甲材料类中选择的参数)放到'resources/assets/minecraft/textures/models/armor'+要给予穿着的盔甲的纹理,只需要将X_layer_1.png和X_layer_2.png(其中X是你在你的盔甲材料类中选择的参数)放到'resources/assets/minecraft/textures/models/armor'
  
  
Line 172: Line 172:
 ==== 添加击退保护 ==== ==== 添加击退保护 ====
  
-And here comes the so very cursed!+来了,非常折磨!
  
-Mojang decided that they were not only going to hardcode getKnockbackResistance, but they were also gonna make it immutable! Fun stuff.+Mojang 决定他们不仅要硬编码 getKnockbackResistance,而且还要让它不可变!笑死。
  
 To get around this, we're gonna make a mixin that goes into ArmorItem. If this is your first time, [[tutorial:mixin_registration|here's how to register mixins on your fabric.mod.json]] To get around this, we're gonna make a mixin that goes into ArmorItem. If this is your first time, [[tutorial:mixin_registration|here's how to register mixins on your fabric.mod.json]]
zh_cn/tutorial/armor.txt · Last modified: 2023/08/20 10:19 by wjz_p