Record Class Difference
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.loot.providers.number.floats.Difference
- All Implemented Interfaces:
BinaryProvider<ContextFloatProvider>, ContextFloatProvider, Validatable
public record Difference(Holder<ContextFloatProvider> left, Holder<ContextFloatProvider> right)
extends Record
implements ContextFloatProvider, BinaryProvider<ContextFloatProvider>
-
Nested Class Summary
Nested classes/interfaces inherited from interface BinaryProvider
BinaryProvider.Factory<Value,Self> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Holder<ContextFloatProvider> The field for theleftrecord component.static final com.mojang.serialization.MapCodec<Difference> private final Holder<ContextFloatProvider> The field for therightrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionDifference(Holder<ContextFloatProvider> left, Holder<ContextFloatProvider> right) Creates an instance of aDifferencerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<Difference> codec()final booleanIndicates whether some other object is "equal to" this one.floatgetFloatUnsafe(LootContext context) final inthashCode()Returns a hash code value for this object.left()Returns the value of theleftrecord component.right()Returns the value of therightrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface BinaryProvider
validateMethods inherited from interface ContextFloatProvider
getFloat, getFloatOrThrow
-
Field Details
-
left
The field for theleftrecord component. -
right
The field for therightrecord component. -
MAP_CODEC
-
-
Constructor Details
-
Difference
Creates an instance of aDifferencerecord class.- Parameters:
left- the value for theleftrecord componentright- the value for therightrecord component
-
-
Method Details
-
codec
- Specified by:
codecin interfaceContextFloatProvider
-
getFloatUnsafe
- Specified by:
getFloatUnsafein interfaceContextFloatProvider
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
left
Returns the value of theleftrecord component.- Specified by:
leftin interfaceBinaryProvider<ContextFloatProvider>- Returns:
- the value of the
leftrecord component
-
right
Returns the value of therightrecord component.- Specified by:
rightin interfaceBinaryProvider<ContextFloatProvider>- Returns:
- the value of the
rightrecord component
-