Record Class BlocksAttacks.DamageReduction
java.lang.Object
java.lang.Record
net.minecraft.world.item.component.BlocksAttacks.DamageReduction
- Enclosing class:
BlocksAttacks
public static record BlocksAttacks.DamageReduction(float horizontalBlockingAngle, Optional<HolderSet<DamageType>> type, float base, float factor)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final floatThe field for thebaserecord component.static final com.mojang.serialization.Codec<BlocksAttacks.DamageReduction> private final floatThe field for thefactorrecord component.private final floatThe field for thehorizontalBlockingAnglerecord component.static final StreamCodec<RegistryFriendlyByteBuf, BlocksAttacks.DamageReduction> private final Optional<HolderSet<DamageType>> The field for thetyperecord component. -
Constructor Summary
ConstructorsConstructorDescriptionDamageReduction(float horizontalBlockingAngle, Optional<HolderSet<DamageType>> type, float base, float factor) Creates an instance of aDamageReductionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatbase()Returns the value of thebaserecord component.final booleanIndicates whether some other object is "equal to" this one.floatfactor()Returns the value of thefactorrecord component.final inthashCode()Returns a hash code value for this object.floatReturns the value of thehorizontalBlockingAnglerecord component.floatresolve(DamageSource pDamageSource, float pDamageAmount, double pHorizontalAngle) final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Field Details
-
horizontalBlockingAngle
private final float horizontalBlockingAngleThe field for thehorizontalBlockingAnglerecord component. -
type
The field for thetyperecord component. -
base
private final float baseThe field for thebaserecord component. -
factor
private final float factorThe field for thefactorrecord component. -
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
DamageReduction
public DamageReduction(float horizontalBlockingAngle, Optional<HolderSet<DamageType>> type, float base, float factor) Creates an instance of aDamageReductionrecord class.- Parameters:
horizontalBlockingAngle- the value for thehorizontalBlockingAnglerecord componenttype- the value for thetyperecord componentbase- the value for thebaserecord componentfactor- the value for thefactorrecord component
-
-
Method Details
-
resolve
-
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 '=='. -
horizontalBlockingAngle
public float horizontalBlockingAngle()Returns the value of thehorizontalBlockingAnglerecord component.- Returns:
- the value of the
horizontalBlockingAnglerecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
base
public float base()Returns the value of thebaserecord component.- Returns:
- the value of the
baserecord component
-
factor
public float factor()Returns the value of thefactorrecord component.- Returns:
- the value of the
factorrecord component
-