记录类 ArmorMaterial
java.lang.Object
java.lang.Record
net.minecraft.world.item.equipment.ArmorMaterial
public record ArmorMaterial(int durability, Map<ArmorType,Integer> defense, int enchantmentValue, Holder<SoundEvent> equipSound, float toughness, float knockbackResistance, TagKey<Item> repairIngredient, ResourceKey<EquipmentAsset> assetId)
extends Record
-
字段概要
字段修饰符和类型字段说明private final ResourceKey
<EquipmentAsset> assetId
记录组件的字段。defense
记录组件的字段。private final int
durability
记录组件的字段。private final int
enchantmentValue
记录组件的字段。private final Holder
<SoundEvent> equipSound
记录组件的字段。private final float
knockbackResistance
记录组件的字段。repairIngredient
记录组件的字段。private final float
toughness
记录组件的字段。 -
构造器概要
构造器构造器说明ArmorMaterial
(int durability, Map<ArmorType, Integer> defense, int enchantmentValue, Holder<SoundEvent> equipSound, float toughness, float knockbackResistance, TagKey<Item> repairIngredient, ResourceKey<EquipmentAsset> assetId) 创建ArmorMaterial
记录类的实例。 -
方法概要
修饰符和类型方法说明animalProperties
(Item.Properties p_369061_, Holder<SoundEvent> p_362547_, boolean p_365564_, HolderSet<EntityType<?>> p_362091_) animalProperties
(Item.Properties p_364372_, HolderSet<EntityType<?>> p_370025_) assetId()
返回assetId
记录组件的值。private ItemAttributeModifiers
createAttributes
(ArmorType p_361798_) defense()
返回defense
记录组件的值。int
返回durability
记录组件的值。int
返回enchantmentValue
记录组件的值。final boolean
指示某个其他对象是否“等于”此对象。返回equipSound
记录组件的值。final int
hashCode()
返回此对象的哈希代码值。humanoidProperties
(Item.Properties p_365115_, ArmorType p_369272_) float
返回knockbackResistance
记录组件的值。返回repairIngredient
记录组件的值。final String
toString()
返回此记录类的字符串表示形式。float
返回toughness
记录组件的值。
-
字段详细资料
-
durability
private final int durabilitydurability
记录组件的字段。 -
defense
defense
记录组件的字段。 -
enchantmentValue
private final int enchantmentValueenchantmentValue
记录组件的字段。 -
equipSound
equipSound
记录组件的字段。 -
toughness
private final float toughnesstoughness
记录组件的字段。 -
knockbackResistance
private final float knockbackResistanceknockbackResistance
记录组件的字段。 -
repairIngredient
repairIngredient
记录组件的字段。 -
assetId
assetId
记录组件的字段。
-
-
构造器详细资料
-
ArmorMaterial
public ArmorMaterial(int durability, Map<ArmorType, Integer> defense, int enchantmentValue, Holder<SoundEvent> equipSound, float toughness, float knockbackResistance, TagKey<Item> repairIngredient, ResourceKey<EquipmentAsset> assetId) 创建ArmorMaterial
记录类的实例。- 参数:
durability
-durability
记录组件的值defense
-defense
记录组件的值enchantmentValue
-enchantmentValue
记录组件的值equipSound
-equipSound
记录组件的值toughness
-toughness
记录组件的值knockbackResistance
-knockbackResistance
记录组件的值repairIngredient
-repairIngredient
记录组件的值assetId
-assetId
记录组件的值
-
-
方法详细资料
-
humanoidProperties
-
animalProperties
public Item.Properties animalProperties(Item.Properties p_364372_, HolderSet<EntityType<?>> p_370025_) -
animalProperties
public Item.Properties animalProperties(Item.Properties p_369061_, Holder<SoundEvent> p_362547_, boolean p_365564_, HolderSet<EntityType<?>> p_362091_) -
createAttributes
-
toString
返回此记录类的字符串表示形式。此表示形式包含类的名称,后跟每个记录组件的名称和值。 -
hashCode
public final int hashCode()返回此对象的哈希代码值。此值派生自每个记录组件的哈希代码。 -
equals
指示某个其他对象是否“等于”此对象。如果两个对象属于同一个类,而且所有记录组件都相等,则这两个对象相等。 使用Objects::equals(Object,Object)
对参考组件进行比较;使用 '==' 对基元组件进行比较 -
durability
public int durability()返回durability
记录组件的值。- 返回:
durability
记录组件的值
-
defense
返回defense
记录组件的值。- 返回:
defense
记录组件的值
-
enchantmentValue
public int enchantmentValue()返回enchantmentValue
记录组件的值。- 返回:
enchantmentValue
记录组件的值
-
equipSound
返回equipSound
记录组件的值。- 返回:
equipSound
记录组件的值
-
toughness
public float toughness()返回toughness
记录组件的值。- 返回:
toughness
记录组件的值
-
knockbackResistance
public float knockbackResistance()返回knockbackResistance
记录组件的值。- 返回:
knockbackResistance
记录组件的值
-
repairIngredient
返回repairIngredient
记录组件的值。- 返回:
repairIngredient
记录组件的值
-
assetId
返回assetId
记录组件的值。- 返回:
assetId
记录组件的值
-