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 float
The field for thebase
record component.static final com.mojang.serialization.Codec
<BlocksAttacks.DamageReduction> private final float
The field for thefactor
record component.private final float
The field for thehorizontalBlockingAngle
record component.static final StreamCodec
<RegistryFriendlyByteBuf, BlocksAttacks.DamageReduction> private final Optional
<HolderSet<DamageType>> The field for thetype
record component. -
Constructor Summary
ConstructorsConstructorDescriptionDamageReduction
(float horizontalBlockingAngle, Optional<HolderSet<DamageType>> type, float base, float factor) Creates an instance of aDamageReduction
record class. -
Method Summary
Modifier and TypeMethodDescriptionfloat
base()
Returns the value of thebase
record component.final boolean
Indicates whether some other object is "equal to" this one.float
factor()
Returns the value of thefactor
record component.final int
hashCode()
Returns a hash code value for this object.float
Returns the value of thehorizontalBlockingAngle
record component.float
resolve
(DamageSource p_399864_, float p_400229_, double p_401381_) final String
toString()
Returns a string representation of this record class.type()
Returns the value of thetype
record component.
-
Field Details
-
horizontalBlockingAngle
private final float horizontalBlockingAngleThe field for thehorizontalBlockingAngle
record component. -
type
The field for thetype
record component. -
base
private final float baseThe field for thebase
record component. -
factor
private final float factorThe field for thefactor
record component. -
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
DamageReduction
public DamageReduction(float horizontalBlockingAngle, Optional<HolderSet<DamageType>> type, float base, float factor) Creates an instance of aDamageReduction
record class.- Parameters:
horizontalBlockingAngle
- the value for thehorizontalBlockingAngle
record componenttype
- the value for thetype
record componentbase
- the value for thebase
record componentfactor
- the value for thefactor
record 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 thehorizontalBlockingAngle
record component.- Returns:
- the value of the
horizontalBlockingAngle
record component
-
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
base
public float base()Returns the value of thebase
record component.- Returns:
- the value of the
base
record component
-
factor
public float factor()Returns the value of thefactor
record component.- Returns:
- the value of the
factor
record component
-