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
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<Holder<ArmorMaterial>> private final Map<ArmorItem.Type, Integer> The field for thedefenserecord component.private final intThe field for theenchantmentValuerecord component.private final Holder<SoundEvent> The field for theequipSoundrecord component.private final floatThe field for theknockbackResistancerecord component.private final List<ArmorMaterial.Layer> The field for thelayersrecord component.private final Supplier<Ingredient> The field for therepairIngredientrecord component.private final floatThe field for thetoughnessrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionArmorMaterial(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 aArmorMaterialrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondefense()Returns the value of thedefenserecord component.intReturns the value of theenchantmentValuerecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theequipSoundrecord component.intgetDefense(ArmorItem.Type p_324094_) final inthashCode()Returns a hash code value for this object.floatReturns the value of theknockbackResistancerecord component.layers()Returns the value of thelayersrecord component.Returns the value of therepairIngredientrecord component.final StringtoString()Returns a string representation of this record class.floatReturns the value of thetoughnessrecord component.
-
Field Details
-
defense
The field for thedefenserecord component. -
enchantmentValue
private final int enchantmentValueThe field for theenchantmentValuerecord component. -
equipSound
The field for theequipSoundrecord component. -
repairIngredient
The field for therepairIngredientrecord component. -
layers
The field for thelayersrecord component. -
toughness
private final float toughnessThe field for thetoughnessrecord component. -
knockbackResistance
private final float knockbackResistanceThe field for theknockbackResistancerecord 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 aArmorMaterialrecord class.- Parameters:
defense- the value for thedefenserecord componentenchantmentValue- the value for theenchantmentValuerecord componentequipSound- the value for theequipSoundrecord componentrepairIngredient- the value for therepairIngredientrecord componentlayers- the value for thelayersrecord componenttoughness- the value for thetoughnessrecord componentknockbackResistance- the value for theknockbackResistancerecord 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 thedefenserecord component.- Returns:
- the value of the
defenserecord component
-
enchantmentValue
public int enchantmentValue()Returns the value of theenchantmentValuerecord component.- Returns:
- the value of the
enchantmentValuerecord component
-
equipSound
Returns the value of theequipSoundrecord component.- Returns:
- the value of the
equipSoundrecord component
-
repairIngredient
Returns the value of therepairIngredientrecord component.- Returns:
- the value of the
repairIngredientrecord component
-
layers
Returns the value of thelayersrecord component.- Returns:
- the value of the
layersrecord component
-
toughness
public float toughness()Returns the value of thetoughnessrecord component.- Returns:
- the value of the
toughnessrecord component
-
knockbackResistance
public float knockbackResistance()Returns the value of theknockbackResistancerecord component.- Returns:
- the value of the
knockbackResistancerecord component
-