Record Class WorldPointProvider

java.lang.Object
java.lang.Record
net.thewinnt.cutscenes.path.point.WorldPointProvider
All Implemented Interfaces:
PointProvider

public record WorldPointProvider(net.minecraft.world.phys.Vec3 point) extends Record implements PointProvider
  • Constructor Details

    • WorldPointProvider

      public WorldPointProvider(net.minecraft.world.phys.Vec3 point)
      Creates an instance of a WorldPointProvider record class.
      Parameters:
      point - the value for the point record 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: PointProvider
      Returns the point this PointProvider represents.
      Specified by:
      getPoint in interface PointProvider
      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: PointProvider
      Writes this point provider's properties to network, so that it can be fully reconstructed later.
      Specified by:
      toNetwork in interface PointProvider
      See Also:
    • getSerializer

      Specified by:
      getSerializer in interface PointProvider
      Returns:
      the serializer associated with this point provider's type. Ideally, this should always be the same object.
    • fromNetwork

      public static WorldPointProvider fromNetwork(net.minecraft.network.FriendlyByteBuf buf)
    • fromJSON

      public static WorldPointProvider fromJSON(com.google.gson.JsonObject obj)
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • point

      public net.minecraft.world.phys.Vec3 point()
      Returns the value of the point record component.
      Returns:
      the value of the point record component