Record Class WaypointProvider
java.lang.Object
java.lang.Record
net.thewinnt.cutscenes.path.point.WaypointProvider
- All Implemented Interfaces:
PointProvider
public record WaypointProvider(String name, int searchRadius, WaypointProvider.SortType sorting, net.minecraft.world.phys.Vec3 offset, Optional<PointProvider> fallback)
extends Record
implements PointProvider
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface net.thewinnt.cutscenes.path.point.PointProvider
PointProvider.PointSerializer<T extends PointProvider> -
Constructor Summary
ConstructorsConstructorDescriptionWaypointProvider(String name, int searchRadius, WaypointProvider.SortType sorting, net.minecraft.world.phys.Vec3 offset, Optional<PointProvider> fallback) Creates an instance of aWaypointProviderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.fallback()Returns the value of thefallbackrecord component.static WaypointProviderfromJSON(com.google.gson.JsonObject obj) static WaypointProviderfromNetwork(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.name()Returns the value of thenamerecord component.net.minecraft.world.phys.Vec3offset()Returns the value of theoffsetrecord component.intReturns the value of thesearchRadiusrecord component.sorting()Returns the value of thesortingrecord 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
-
WaypointProvider
public WaypointProvider(String name, int searchRadius, WaypointProvider.SortType sorting, net.minecraft.world.phys.Vec3 offset, Optional<PointProvider> fallback) Creates an instance of aWaypointProviderrecord class.- Parameters:
name- the value for thenamerecord componentsearchRadius- the value for thesearchRadiusrecord componentsorting- the value for thesortingrecord componentoffset- the value for theoffsetrecord componentfallback- the value for thefallbackrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
searchRadius
public int searchRadius()Returns the value of thesearchRadiusrecord component.- Returns:
- the value of the
searchRadiusrecord component
-
sorting
Returns the value of thesortingrecord component.- Returns:
- the value of the
sortingrecord component
-
offset
public net.minecraft.world.phys.Vec3 offset()Returns the value of theoffsetrecord component.- Returns:
- the value of the
offsetrecord component
-
fallback
Returns the value of thefallbackrecord component.- Returns:
- the value of the
fallbackrecord component
-