Package net.minecraft.world.item
Record Class ArmorMaterial
java.lang.Object
java.lang.Record
net.minecraft.world.item.ArmorMaterial
public record ArmorMaterial(Map<ArmorItem.Type,Integer> defense, int enchantmentValue, Holder<SoundEvent> equipSound, Supplier<Ingredient> repairIngredient, List<ArmorMaterial.Layer> layers, float toughness, float knockbackResistance)
extends Record
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<Holder<ArmorMaterial>> private final Map
<ArmorItem.Type, Integer> The field for thedefense
record component.private final int
The field for theenchantmentValue
record component.private final Holder
<SoundEvent> The field for theequipSound
record component.private final float
The field for theknockbackResistance
record component.private final List
<ArmorMaterial.Layer> The field for thelayers
record component.private final Supplier
<Ingredient> The field for therepairIngredient
record component.private final float
The field for thetoughness
record component. -
Constructor Summary
ConstructorDescriptionArmorMaterial
(Map<ArmorItem.Type, Integer> defense, int enchantmentValue, Holder<SoundEvent> equipSound, Supplier<Ingredient> repairIngredient, List<ArmorMaterial.Layer> layers, float toughness, float knockbackResistance) Creates an instance of aArmorMaterial
record class. -
Method Summary
Modifier and TypeMethodDescriptiondefense()
Returns the value of thedefense
record component.int
Returns the value of theenchantmentValue
record component.final boolean
Indicates whether some other object is "equal to" this one.Returns the value of theequipSound
record component.int
getDefense
(ArmorItem.Type p_324094_) final int
hashCode()
Returns a hash code value for this object.float
Returns the value of theknockbackResistance
record component.layers()
Returns the value of thelayers
record component.Returns the value of therepairIngredient
record component.final String
toString()
Returns a string representation of this record class.float
Returns the value of thetoughness
record component.
-
Field Details
-
defense
The field for thedefense
record component. -
enchantmentValue
private final int enchantmentValueThe field for theenchantmentValue
record component. -
equipSound
The field for theequipSound
record component. -
repairIngredient
The field for therepairIngredient
record component. -
layers
The field for thelayers
record component. -
toughness
private final float toughnessThe field for thetoughness
record component. -
knockbackResistance
private final float knockbackResistanceThe field for theknockbackResistance
record component. -
CODEC
-
-
Constructor Details
-
ArmorMaterial
public ArmorMaterial(Map<ArmorItem.Type, Integer> defense, int enchantmentValue, Holder<SoundEvent> equipSound, Supplier<Ingredient> repairIngredient, List<ArmorMaterial.Layer> layers, float toughness, float knockbackResistance) Creates an instance of aArmorMaterial
record class.- Parameters:
defense
- the value for thedefense
record componentenchantmentValue
- the value for theenchantmentValue
record componentequipSound
- the value for theequipSound
record componentrepairIngredient
- the value for therepairIngredient
record componentlayers
- the value for thelayers
record componenttoughness
- the value for thetoughness
record componentknockbackResistance
- the value for theknockbackResistance
record component
-
-
Method Details
-
getDefense
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
defense
Returns the value of thedefense
record component.- Returns:
- the value of the
defense
record component
-
enchantmentValue
public int enchantmentValue()Returns the value of theenchantmentValue
record component.- Returns:
- the value of the
enchantmentValue
record component
-
equipSound
Returns the value of theequipSound
record component.- Returns:
- the value of the
equipSound
record component
-
repairIngredient
Returns the value of therepairIngredient
record component.- Returns:
- the value of the
repairIngredient
record component
-
layers
Returns the value of thelayers
record component.- Returns:
- the value of the
layers
record component
-
toughness
public float toughness()Returns the value of thetoughness
record component.- Returns:
- the value of the
toughness
record component
-
knockbackResistance
public float knockbackResistance()Returns the value of theknockbackResistance
record component.- Returns:
- the value of the
knockbackResistance
record component
-