Record Class StaticPointProvider
java.lang.Object
java.lang.Record
net.thewinnt.cutscenes.path.point.StaticPointProvider
- All Implemented Interfaces:
PointProvider
public record StaticPointProvider(net.minecraft.world.phys.Vec3 point)
extends Record
implements PointProvider
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.thewinnt.cutscenes.path.point.PointProvider
PointProvider.PointSerializer<T extends PointProvider> -
Constructor Summary
ConstructorsConstructorDescriptionStaticPointProvider(net.minecraft.world.phys.Vec3 point) Creates an instance of aStaticPointProviderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static StaticPointProviderfromJSON(com.google.gson.JsonObject obj) static StaticPointProviderfromNetwork(net.minecraft.network.FriendlyByteBuf buf) net.minecraft.world.phys.Vec3getPoint(net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 cutsceneStart) Returns the point this PointProvider represents.final inthashCode()Returns a hash code value for this object.net.minecraft.world.phys.Vec3point()Returns the value of thepointrecord component.voidtoNetwork(net.minecraft.network.FriendlyByteBuf buf) Writes this point provider's properties to network, so that it can be fully reconstructed later.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
StaticPointProvider
public StaticPointProvider(net.minecraft.world.phys.Vec3 point) Creates an instance of aStaticPointProviderrecord class.- Parameters:
point- the value for thepointrecord component
-
-
Method Details
-
getPoint
public net.minecraft.world.phys.Vec3 getPoint(net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 cutsceneStart) Description copied from interface:PointProviderReturns the point this PointProvider represents.- Specified by:
getPointin interfacePointProvider- Parameters:
level- the level the point is being obtained in.cutsceneStart- the starting position of the cutscene- Returns:
- a point, relative to the starting position, or a rotation relative to the starting rotation
- See Also:
-
toNetwork
public void toNetwork(net.minecraft.network.FriendlyByteBuf buf) Description copied from interface:PointProviderWrites this point provider's properties to network, so that it can be fully reconstructed later.- Specified by:
toNetworkin interfacePointProvider- See Also:
-
getSerializer
- Specified by:
getSerializerin interfacePointProvider- Returns:
- the serializer associated with this point provider's type. Ideally, this should always be the same object.
-
fromNetwork
-
fromJSON
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
point
public net.minecraft.world.phys.Vec3 point()Returns the value of thepointrecord component.- Returns:
- the value of the
pointrecord component
-