Record Class FixedKNumber
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.knumber.FixedKNumber
- 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, MAX_TICK, ONE, PREFIX_LIST, PROGRESS, REGISTRY, STREAM_CODEC, TICK, ZEROFields inherited from interface WithKey
COMPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionFixedKNumber(double value) FixedKNumber(@Nullable UnitType<net.minecraft.network.RegistryFriendlyByteBuf, KNumber> typeOverride, Double number) Creates an instance of aFixedKNumberrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.get(KNumberContext ctx) final inthashCode()Returns a hash code value for this object.number()Returns the value of thenumberrecord component.@NonNull StringtoString()Returns a string representation of this record class.CustomRegistryType<net.minecraft.network.RegistryFriendlyByteBuf, KNumber> type()Returns the value of thetypeOverriderecord component.Methods inherited from interface CustomRegistryValue
optionalKey, refMethods inherited from interface KNumber
getOr, getOrNaN, getRegistry, isStringLiteralMethods inherited from interface RefOptimizer
optimize
-
Field Details
-
TYPE
-
-
Constructor Details
-
FixedKNumber
public FixedKNumber(double value) -
FixedKNumber
public FixedKNumber(@Nullable @Nullable UnitType<net.minecraft.network.RegistryFriendlyByteBuf, KNumber> typeOverride, Double number) Creates an instance of aFixedKNumberrecord class.- Parameters:
typeOverride- the value for thetypeOverriderecord componentnumber- the value for thenumberrecord component
-
-
Method Details
-
type
- Specified by:
typein interfaceCustomRegistryOwnTypeProvider<net.minecraft.network.RegistryFriendlyByteBuf, KNumber>
-
get
-
offset
-
scale
-
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). -
typeOverride
-
number
Returns the value of thenumberrecord component.- Returns:
- the value of the
numberrecord component
-