Record Class IfKNumber
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.knumber.IfKNumber
- All Implemented Interfaces:
KNumber, CustomRegistryOwnTypeProvider<net.minecraft.network.RegistryFriendlyByteBuf, KNumber>, CustomRegistryValue<net.minecraft.network.RegistryFriendlyByteBuf, KNumber>, RefOptimizer<KNumber>, WithKey, WithRef<KNumber>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DynamicType<net.minecraft.network.RegistryFriendlyByteBuf, KNumber> Fields inherited from interface KNumber
CLOCK, CODEC, DATA_TYPE, ERROR_NOT_A_NUMBER, GAME_DAY, GAME_TIME, HALF, MAX_TICK, ONE, PREFIX_LIST, PROGRESS, REGISTRY, STREAM_CODEC, TICK, TWO, ZEROFields inherited from interface WithKey
COMPARATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecomparisonrecord component.Returns the value of theelseValuerecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable Doubleget(KNumberContext ctx) final inthashCode()Returns a hash code value for this object.ifValue()Returns the value of theifValuerecord component.Returns the value of thetestValuerecord component.Returns the value of thethenValuerecord component.final StringtoString()Returns a string representation of this record class.DynamicType<net.minecraft.network.RegistryFriendlyByteBuf, KNumber> type()Methods inherited from interface CustomRegistryValue
optionalKey, refMethods inherited from interface KNumber
getOr, getOrNaN, getRegistry, isStringLiteral, offset, scaleMethods inherited from interface RefOptimizer
optimize
-
Field Details
-
TYPE
-
-
Constructor Details
-
IfKNumber
public IfKNumber(Ref<KNumber> ifValue, Comparison comparison, Ref<KNumber> testValue, Optional<Ref<KNumber>> thenValue, Optional<Ref<KNumber>> elseValue) Creates an instance of aIfKNumberrecord class.- Parameters:
ifValue- the value for theifValuerecord componentcomparison- the value for thecomparisonrecord componenttestValue- the value for thetestValuerecord componentthenValue- the value for thethenValuerecord componentelseValue- the value for theelseValuerecord component
-
-
Method Details
-
type
- Specified by:
typein interfaceCustomRegistryOwnTypeProvider<net.minecraft.network.RegistryFriendlyByteBuf, KNumber>
-
get
-
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). -
ifValue
-
comparison
Returns the value of thecomparisonrecord component.- Returns:
- the value of the
comparisonrecord component
-
testValue
-
thenValue
-
elseValue
-