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

Both sides previous revisionPrevious revision
Next revision
Previous revision
zh_cn:tutorial:armor [2022/12/16 00:31] solidblockzh_cn:tutorial:armor [2023/08/20 10:19] (current) – [提供纹理] wjz_p
Line 18: Line 18:
  private static final int[] PROTECTION_VALUES = new int[] {A, B, C, D};   private static final int[] PROTECTION_VALUES = new int[] {A, B, C, D}; 
  
- // 其中A是头盔,B是胸甲,C是护腿,D是靴子。+ // 其中A是头盔,B是护腿,C是胸甲,D是靴子。
  // 例如,皮革使用{1, 2, 3, 1},钻石和下界合金使用{3, 6, 8, 3}  // 例如,皮革使用{1, 2, 3, 1},钻石和下界合金使用{3, 6, 8, 3}
 } }
Line 25: Line 25:
 接下来的变量如下定义(无需担心名称,下面你会看到如何实现): 接下来的变量如下定义(无需担心名称,下面你会看到如何实现):
  
-  - <yarn method_7696>: how many hits can armor take before breaking. Uses the int we wrote on 'BASE_DURABILITY' to calculate. Leather uses 5, Diamond 33, Netherite 37. +  - <yarn method_7696>: how many hits can armor take before breaking. Uses the int we wrote on 'BASE_DURABILITY' to calculate. Leather uses 5, Diamond 33, Netherite 37.   
-  - <yarn method_7697>: calls for the 'PROTECTION_VALUES' int we already wrote above.+**计算你的盔甲在损坏之前能承受多少次打击,利用的是你在'BASE_DURABILITY'里所写的int值。皮革是5,钻石33,下届合金的是37。** 
 + 
 +  - <yarn method_7697>: calls for the 'PROTECTION_VALUES' int we already wrote above.   
 +**调用以获取我们之前定义的'PROTECTION_VALUES'.** 
   - <yarn method_7699>: This will be how likely the armor can get high level or multiple enchantments in an enchantment book.   - <yarn method_7699>: This will be how likely the armor can get high level or multiple enchantments in an enchantment book.
 +**获取关于这件盔甲能够在一本附魔书中被附魔到多高等级、多少种类的附魔**
 +
   - <yarn class_3414 method_7698>: The standard used by vanilla armor is ''<yarn class_3417>.ITEM_ARMOR_EQUIP_X'', X being the type of armor.   - <yarn class_3414 method_7698>: The standard used by vanilla armor is ''<yarn class_3417>.ITEM_ARMOR_EQUIP_X'', X being the type of armor.
 +**在原版盔甲中,这个标准是''<yarn class_3417>.ITEM_ARMOR_EQUIP_X'',其中X是你的盔甲类型**
 +
   - <yarn class_1856 method_7695>: what item are we gonna be using to repair the armor on an anvil. It can be either a vanilla item or one of your own.   - <yarn class_1856 method_7695>: what item are we gonna be using to repair the armor on an anvil. It can be either a vanilla item or one of your own.
 +**获取我们应该在铁砧中用什么来修复这件盔甲,材料可以是原版的,也可以是你自己的模组中的物品**
 +
   - String <yarn method_7694>: what the parent item of the armor is. In Diamond armor, it'd be "diamond".   - String <yarn method_7694>: what the parent item of the armor is. In Diamond armor, it'd be "diamond".
   - <yarn method_7700>: This is a second protection value where the armor is more durable against high value attacks. Value goes as 'X.0F'   - <yarn method_7700>: This is a second protection value where the armor is more durable against high value attacks. Value goes as 'X.0F'
 +**这是第二个保护数值,表示装甲在面对高伤害攻击时更耐用。数值为'X.0F'。**
 在1.16引入的新值 在1.16引入的新值
   - <yarn method_24355>: leave this value at 0. If you want to implement it, write '0.XF' (in which X is how much knockback protection you want), and I'll teach you how to make it work later on.   - <yarn method_24355>: leave this value at 0. If you want to implement it, write '0.XF' (in which X is how much knockback protection you want), and I'll teach you how to make it work later on.
 +**将这个值保留为0。如果你想实现它,写上'0.XF'(其中X代表你想要的击退保护量),我会稍后告诉你如何让它生效。**
  
 接下来所有的参数都会写成 X 或者 A、B、C、D。加上这些参数之后,效果应该如下: 接下来所有的参数都会写成 X 或者 A、B、C、D。加上这些参数之后,效果应该如下:
Line 161: Line 171:
 重复上述过程,完成其他物品。 重复上述过程,完成其他物品。
  
-要给予穿着的盔甲的纹理,只需要将X_layer_1.png和X_layer_2.png(其中X是你在你的盔甲材料类中选择参数)放到 'resources/assets/minecraft/textures/models/armor'+要给予穿着的盔甲的纹理,只需要将X_layer_1.png和X_layer_2.png(其中X是你在你的盔甲材料类中重载getName方法的返回值)放到 'resources/assets/**minecraft**/textures/models/armor'
  
  
zh_cn/tutorial/armor.1671150701.txt.gz · Last modified: 2022/12/16 00:31 by solidblock