Record Class SimpleEntityNumber
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.entity.number.SimpleEntityNumber
- 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 SimpleEntityNumber(UnitType<net.minecraft.network.RegistryFriendlyByteBuf, EntityNumber> type, ToDoubleFunction<net.minecraft.world.entity.Entity> function)
extends Record
implements EntityNumber
-
Field Summary
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
ConstructorsConstructorDescriptionSimpleEntityNumber(UnitType<net.minecraft.network.RegistryFriendlyByteBuf, EntityNumber> type, ToDoubleFunction<net.minecraft.world.entity.Entity> function) Creates an instance of aSimpleEntityNumberrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleapplyAsDouble(net.minecraft.world.entity.Entity entity) final booleanIndicates whether some other object is "equal to" this one.ToDoubleFunction<net.minecraft.world.entity.Entity> function()Returns the value of thefunctionrecord component.final inthashCode()Returns a hash code value for this object.toString()Returns a string representation of this record class.UnitType<net.minecraft.network.RegistryFriendlyByteBuf, EntityNumber> type()Returns the value of thetyperecord component.Methods inherited from interface CustomRegistryValue
optionalKey, refMethods inherited from interface EntityNumber
getRegistryMethods inherited from interface RefOptimizer
optimize
-
Constructor Details
-
SimpleEntityNumber
public SimpleEntityNumber(UnitType<net.minecraft.network.RegistryFriendlyByteBuf, EntityNumber> type, ToDoubleFunction<net.minecraft.world.entity.Entity> function) Creates an instance of aSimpleEntityNumberrecord class.- Parameters:
type- the value for thetyperecord componentfunction- the value for thefunctionrecord component
-
-
Method Details
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
type
Returns the value of thetyperecord component.- Specified by:
typein interfaceCustomRegistryOwnTypeProvider<net.minecraft.network.RegistryFriendlyByteBuf, EntityNumber>- Returns:
- the value of the
typerecord component
-
function
Returns the value of thefunctionrecord component.- Returns:
- the value of the
functionrecord component
-