Record Class FixedEntityNumber
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.entity.number.FixedEntityNumber
- All Implemented Interfaces:
EntityNumber, CustomRegistryOwnTypeProvider<net.minecraft.network.RegistryFriendlyByteBuf, EntityNumber>, CustomRegistryValue<net.minecraft.network.RegistryFriendlyByteBuf, EntityNumber>, RefOptimizer<EntityNumber>, WithKey, WithRef<EntityNumber>, ToDoubleFunction<net.minecraft.world.entity.Entity>
public record FixedEntityNumber(@Nullable UnitType<net.minecraft.network.RegistryFriendlyByteBuf, EntityNumber> typeOverride, double number)
extends Record
implements EntityNumber
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DynamicType<net.minecraft.network.RegistryFriendlyByteBuf, EntityNumber> Fields inherited from interface EntityNumber
AIR_SUPPLY, BLOCK_X, BLOCK_Y, BLOCK_Z, BODY_YAW, CODEC, HEAD_YAW, HEALTH, HEIGHT, MAX_AIR_SUPPLY, MAX_HEALTH, ONE, PITCH, REGISTRY, RELATIVE_HEALTH, STREAM_CODEC, VISUAL_YAW, WIDTH, X, Y, YAW, Z, ZEROFields inherited from interface WithKey
COMPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionFixedEntityNumber(double number) FixedEntityNumber(@Nullable UnitType<net.minecraft.network.RegistryFriendlyByteBuf, EntityNumber> typeOverride, double number) Creates an instance of aFixedEntityNumberrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleapplyAsDouble(net.minecraft.world.entity.Entity entity) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doublenumber()Returns the value of thenumberrecord component.final StringtoString()Returns a string representation of this record class.CustomRegistryType<net.minecraft.network.RegistryFriendlyByteBuf, EntityNumber> type()@Nullable UnitType<net.minecraft.network.RegistryFriendlyByteBuf, EntityNumber> Returns the value of thetypeOverriderecord component.Methods inherited from interface CustomRegistryValue
optionalKey, refMethods inherited from interface EntityNumber
getRegistryMethods inherited from interface RefOptimizer
optimize
-
Field Details
-
TYPE
-
-
Constructor Details
-
FixedEntityNumber
public FixedEntityNumber(double number) -
FixedEntityNumber
public FixedEntityNumber(@Nullable @Nullable UnitType<net.minecraft.network.RegistryFriendlyByteBuf, EntityNumber> typeOverride, double number) Creates an instance of aFixedEntityNumberrecord class.- Parameters:
typeOverride- the value for thetypeOverriderecord componentnumber- the value for thenumberrecord component
-
-
Method Details
-
type
- Specified by:
typein interfaceCustomRegistryOwnTypeProvider<net.minecraft.network.RegistryFriendlyByteBuf, EntityNumber>
-
applyAsDouble
public double applyAsDouble(net.minecraft.world.entity.Entity entity) - Specified by:
applyAsDoublein interfaceToDoubleFunction<net.minecraft.world.entity.Entity>
-
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. -
typeOverride
@Nullable public @Nullable UnitType<net.minecraft.network.RegistryFriendlyByteBuf, EntityNumber> typeOverride()Returns the value of thetypeOverriderecord component.- Returns:
- the value of the
typeOverriderecord component
-
number
public double number()Returns the value of thenumberrecord component.- Returns:
- the value of the
numberrecord component
-