Record Class SimpleParticle2D

java.lang.Object
java.lang.Record
top.girlkisser.lazuli.api.client.particle2d.SimpleParticle2D
Record Components:
texture - The particle's texture.
position - The particle's position.
velocity - The particle's velocity.
gravity - A gravity force to apply to the velocity every tick.
size - The particle's size.
lifetime - The particle's lifetime.
All Implemented Interfaces:
IParticle2D

public record SimpleParticle2D(net.minecraft.resources.ResourceLocation texture, org.joml.Vector2f position, org.joml.Vector2f velocity, org.joml.Vector2f gravity, org.joml.Vector2i size, int lifetime) extends Record implements IParticle2D
A simple implementation of IParticle2D.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SimpleParticle2D(net.minecraft.resources.ResourceLocation texture, org.joml.Vector2f position, org.joml.Vector2f velocity, org.joml.Vector2f gravity, org.joml.Vector2i size, int lifetime)
    Creates an instance of a SimpleParticle2D record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    org.joml.Vector2f
    Returns the value of the gravity record component.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the lifetime record component.
    org.joml.Vector2f
    Returns the value of the position record component.
    void
    render(InstancedParticle2D instance, net.minecraft.client.gui.GuiGraphics graphics, float partialTick)
    Renders this particle using the provided GuiGraphics.
    org.joml.Vector2i
    Returns the value of the size record component.
    net.minecraft.resources.ResourceLocation
    Returns the value of the texture record component.
    final String
    Returns a string representation of this record class.
    org.joml.Vector2f
    Returns the value of the velocity record component.

    Methods inherited from class java.lang.Object

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

    • SimpleParticle2D

      public SimpleParticle2D(net.minecraft.resources.ResourceLocation texture, org.joml.Vector2f position, org.joml.Vector2f velocity, org.joml.Vector2f gravity, org.joml.Vector2i size, int lifetime)
      Creates an instance of a SimpleParticle2D record class.
      Parameters:
      texture - the value for the texture record component
      position - the value for the position record component
      velocity - the value for the velocity record component
      gravity - the value for the gravity record component
      size - the value for the size record component
      lifetime - the value for the lifetime record component
  • Method Details

    • render

      public void render(InstancedParticle2D instance, net.minecraft.client.gui.GuiGraphics graphics, float partialTick)
      Description copied from interface: IParticle2D
      Renders this particle using the provided GuiGraphics.
      Specified by:
      render in interface IParticle2D
      Parameters:
      instance - The InstancedParticle2D to render.
      graphics - The graphics to draw using.
      partialTick - The game's partial tick.
    • 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.
    • texture

      public net.minecraft.resources.ResourceLocation texture()
      Returns the value of the texture record component.
      Specified by:
      texture in interface IParticle2D
      Returns:
      the value of the texture record component
    • position

      public org.joml.Vector2f position()
      Returns the value of the position record component.
      Specified by:
      position in interface IParticle2D
      Returns:
      the value of the position record component
    • velocity

      public org.joml.Vector2f velocity()
      Returns the value of the velocity record component.
      Returns:
      the value of the velocity record component
    • gravity

      public org.joml.Vector2f gravity()
      Returns the value of the gravity record component.
      Returns:
      the value of the gravity record component
    • size

      public org.joml.Vector2i size()
      Returns the value of the size record component.
      Specified by:
      size in interface IParticle2D
      Returns:
      the value of the size record component
    • lifetime

      public int lifetime()
      Returns the value of the lifetime record component.
      Specified by:
      lifetime in interface IParticle2D
      Returns:
      the value of the lifetime record component