Record Class Power
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.loot.providers.number.floats.Power
- All Implemented Interfaces:
ContextFloatProvider, PowerProvider<ContextFloatProvider>, Validatable
public record Power(Holder<ContextFloatProvider> base, Holder<ContextFloatProvider> exponent)
extends Record
implements ContextFloatProvider, PowerProvider<ContextFloatProvider>
-
Nested Class Summary
Nested classes/interfaces inherited from interface PowerProvider
PowerProvider.Factory<Value,Self> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Holder<ContextFloatProvider> The field for thebaserecord component.private final Holder<ContextFloatProvider> The field for theexponentrecord component.static final com.mojang.serialization.MapCodec<Power> -
Constructor Summary
ConstructorsConstructorDescriptionPower(Holder<ContextFloatProvider> base, Holder<ContextFloatProvider> exponent) Creates an instance of aPowerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbase()Returns the value of thebaserecord component.com.mojang.serialization.MapCodec<Power> codec()final booleanIndicates whether some other object is "equal to" this one.exponent()Returns the value of theexponentrecord component.floatgetFloatUnsafe(LootContext context) final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.Methods inherited from interface ContextFloatProvider
getFloat, getFloatOrThrowMethods inherited from interface PowerProvider
validate
-
Field Details
-
base
The field for thebaserecord component. -
exponent
The field for theexponentrecord component. -
MAP_CODEC
-
-
Constructor Details
-
Power
Creates an instance of aPowerrecord class.- Parameters:
base- the value for thebaserecord componentexponent- the value for theexponentrecord 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). -
base
Returns the value of thebaserecord component.- Specified by:
basein interfacePowerProvider<ContextFloatProvider>- Returns:
- the value of the
baserecord component
-
exponent
Returns the value of theexponentrecord component.- Specified by:
exponentin interfacePowerProvider<ContextFloatProvider>- Returns:
- the value of the
exponentrecord component
-