Record Class AccessoryEffectInstance
java.lang.Object
java.lang.Record
tech.anonymoushacker1279.immersiveweapons.item.accessory.AccessoryEffectInstance
public record AccessoryEffectInstance(AccessoryEffectType type, Optional<AccessoryEffectScalingType> scalingType, double value)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<AccessoryEffectInstance> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.FriendlyByteBuf, AccessoryEffectInstance> -
Constructor Summary
ConstructorsConstructorDescriptionAccessoryEffectInstance(AccessoryEffectType type, Optional<AccessoryEffectScalingType> scalingType, double value) Creates an instance of aAccessoryEffectInstancerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thescalingTyperecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.doublevalue()Returns the value of thevaluerecord component.
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.FriendlyByteBuf, AccessoryEffectInstance> STREAM_CODEC
-
-
Constructor Details
-
AccessoryEffectInstance
public AccessoryEffectInstance(AccessoryEffectType type, Optional<AccessoryEffectScalingType> scalingType, double value) Creates an instance of aAccessoryEffectInstancerecord class.- Parameters:
type- the value for thetyperecord componentscalingType- the value for thescalingTyperecord componentvalue- the value for thevaluerecord component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
scalingType
Returns the value of thescalingTyperecord component.- Returns:
- the value of the
scalingTyperecord component
-
value
public double value()Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-