Record Class VfxParams

java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcanvas.api.vfx.VfxParams
Record Components:
position - where it happens
target - a second point: where a beam ends, or the direction a burst flies (as a point offset from position); equal to position when unused
color - its colour, as 0xRRGGBB
scale - its size or strength, 1 being the effect's normal one

public record VfxParams(net.minecraft.world.phys.Vec3 position, net.minecraft.world.phys.Vec3 target, int color, float scale) extends Record
What the server tells a client about one playing of a world effect. What each field means is up to the effect; the usual reading is given here.
  • Constructor Summary

    Constructors
    Constructor
    Description
    VfxParams(net.minecraft.world.phys.Vec3 position, net.minecraft.world.phys.Vec3 target, int color, float scale)
    Creates an instance of a VfxParams record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    static VfxParams
    at(net.minecraft.world.phys.Vec3 position)
     
    static VfxParams
    at(net.minecraft.world.phys.Vec3 position, int color)
     
    static VfxParams
    between(net.minecraft.world.phys.Vec3 from, net.minecraft.world.phys.Vec3 to, int color)
     
    int
    Returns the value of the color record component.
    net.minecraft.world.phys.Vec3
    From position towards target; zero when they are the same point.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    net.minecraft.world.phys.Vec3
    Returns the value of the position record component.
    float
    Returns the value of the scale record component.
    net.minecraft.world.phys.Vec3
    Returns the value of the target record component.
    final String
    Returns a string representation of this record class.
    withColor(int color)
     
    withScale(float scale)
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • VfxParams

      public VfxParams(net.minecraft.world.phys.Vec3 position, net.minecraft.world.phys.Vec3 target, int color, float scale)
      Creates an instance of a VfxParams record class.
      Parameters:
      position - the value for the position record component
      target - the value for the target record component
      color - the value for the color record component
      scale - the value for the scale record component
  • Method Details

    • at

      public static VfxParams at(net.minecraft.world.phys.Vec3 position)
    • at

      public static VfxParams at(net.minecraft.world.phys.Vec3 position, int color)
    • between

      public static VfxParams between(net.minecraft.world.phys.Vec3 from, net.minecraft.world.phys.Vec3 to, int color)
    • withScale

      public VfxParams withScale(float scale)
    • withColor

      public VfxParams withColor(int color)
    • direction

      public net.minecraft.world.phys.Vec3 direction()
      From position towards target; zero when they are the same point.
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • position

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

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

      public int color()
      Returns the value of the color record component.
      Returns:
      the value of the color record component
    • scale

      public float scale()
      Returns the value of the scale record component.
      Returns:
      the value of the scale record component