Record Class SimpleKVector
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.kvector.SimpleKVector
- All Implemented Interfaces:
KVector, CustomRegistryOwnTypeProvider<net.minecraft.network.RegistryFriendlyByteBuf, KVector>, CustomRegistryValue<net.minecraft.network.RegistryFriendlyByteBuf, KVector>, RefOptimizer<KVector>, WithKey, WithRef<KVector>
-
Field Summary
Fields inherited from interface KVector
CODEC, DATA_TYPE, ERROR_NOT_A_NUMBER, ERROR_NOT_A_VECTOR, ONE, ORIGIN, PREFIX_LIST, REGISTRY, SOURCE, STREAM_CODEC, TARGET, ZEROFields inherited from interface WithKey
COMPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionSimpleKVector(UnitType<net.minecraft.network.RegistryFriendlyByteBuf, KVector> type, Function<KNumberContext, net.minecraft.world.phys.Vec3> factory) Creates an instance of aSimpleKVectorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Function<KNumberContext, net.minecraft.world.phys.Vec3> factory()Returns the value of thefactoryrecord component.@Nullable net.minecraft.world.phys.Vec3get(KNumberContext ctx) final inthashCode()Returns a hash code value for this object.@NonNull StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.Methods inherited from interface CustomRegistryValue
optionalKey, refMethods inherited from interface KVector
getRegistry, isStringLiteral, offset, scaleMethods inherited from interface RefOptimizer
optimize
-
Constructor Details
-
SimpleKVector
public SimpleKVector(UnitType<net.minecraft.network.RegistryFriendlyByteBuf, KVector> type, Function<KNumberContext, net.minecraft.world.phys.Vec3> factory) Creates an instance of aSimpleKVectorrecord class.- Parameters:
type- the value for thetyperecord componentfactory- the value for thefactoryrecord component
-
-
Method Details
-
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). -
type
Returns the value of thetyperecord component.- Specified by:
typein interfaceCustomRegistryOwnTypeProvider<net.minecraft.network.RegistryFriendlyByteBuf, KVector>- Returns:
- the value of the
typerecord component
-
factory
Returns the value of thefactoryrecord component.- Returns:
- the value of the
factoryrecord component
-