Class ConstantPoint

java.lang.Object
net.thewinnt.cutscenes.path.ConstantPoint
All Implemented Interfaces:
PathLike

public class ConstantPoint extends Object implements PathLike
  • Constructor Details

    • ConstantPoint

      public ConstantPoint(net.minecraft.world.phys.Vec3 point)
    • ConstantPoint

      public ConstantPoint(net.minecraft.world.phys.Vec3 point, int weight)
    • ConstantPoint

      public ConstantPoint(PointProvider point, int weight)
  • Method Details

    • getStart

      public PointProvider getStart(net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 cutsceneStart)
      Description copied from interface: PathLike
      Returns a PointProvider representing the starting position for this segment. Ideally, this should match the output of getPoint(0, level, cutsceneStart). Used in paths and path transitions.
      Specified by:
      getStart in interface PathLike
      Parameters:
      level - the level where the cutscene is run
      cutsceneStart - the starting position of the cutscene
      Returns:
      the PointProvider representing the starting position for this segment
    • getEnd

      public PointProvider getEnd(net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 cutsceneStart)
      Description copied from interface: PathLike
      Returns a PointProvider representing the end position for this segment. Ideally, this should match the output of getPoint(1, level, cutsceneStart). Used in paths and path transitions.
      Specified by:
      getEnd in interface PathLike
      Parameters:
      level - the level where the cutscene is run
      cutsceneStart - the starting position of the cutscene
      Returns:
      the PointProvider representing the end position for this segment
    • getPoint

      public net.minecraft.world.phys.Vec3 getPoint(double t, net.minecraft.world.level.Level l, net.minecraft.world.phys.Vec3 s)
      Description copied from interface: PathLike
      Returns the position at the given moment. Depending on the context, it may be treated differently:
      • If the segment is representing the camera position, the resulting position will be treated as an offset from the cutscene starting position, which will then be rotated around the starting point by three axes, depending on the parameters the cutscene was started with.
      • If the segment is representing camera rotation, this method's output will be treated as an offset from the starting camera rotation of the cutscene.
      Specified by:
      getPoint in interface PathLike
      Parameters:
      t - the progress of the current segment, in range [0, 1]. 0 corresponds to the starting position and 1 is the end position.
      l - the level where the cutscene is run
      s - the starting position of the cutscene
      Returns:
      a point corresponding to the given progress value of the segment.
    • getWeight

      public int getWeight()
      Description copied from interface: PathLike
      Returns the weight of this segment. Used for timing in paths. The higher the value, the more time is dedicated to this segment and the slower it runs, and vice-versa.
      Specified by:
      getWeight in interface PathLike
      Returns:
      this segment's weight
    • toNetwork

      public void toNetwork(net.minecraft.network.FriendlyByteBuf buf)
      Description copied from interface: PathLike
      Writes this segment's parameters to the provided FriendlyByteBuf. This data should be enough to fully reconstruct this segment on the client.
      Specified by:
      toNetwork in interface PathLike
      See Also:
    • getSerializer

      public PathLike.SegmentSerializer<?> getSerializer()
      Description copied from interface: PathLike
      Returns the serializer that is associated with this segment type. Preferably, this should return the same object every time it's called.
      Specified by:
      getSerializer in interface PathLike
      Returns:
      a serializer for this segment's type
    • fromNetwork

      public static ConstantPoint fromNetwork(net.minecraft.network.FriendlyByteBuf buf, Path path)
    • fromJSON

      public static ConstantPoint fromJSON(com.google.gson.JsonObject json, Path path)