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
ConstructorsConstructorDescriptionSimpleParticle2D(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 aSimpleParticle2Drecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.org.joml.Vector2fgravity()Returns the value of thegravityrecord component.final inthashCode()Returns a hash code value for this object.intlifetime()Returns the value of thelifetimerecord component.org.joml.Vector2fposition()Returns the value of thepositionrecord component.voidrender(InstancedParticle2D instance, net.minecraft.client.gui.GuiGraphics graphics, float partialTick) Renders this particle using the providedGuiGraphics.org.joml.Vector2isize()Returns the value of thesizerecord component.net.minecraft.resources.ResourceLocationtexture()Returns the value of thetexturerecord component.final StringtoString()Returns a string representation of this record class.org.joml.Vector2fvelocity()Returns the value of thevelocityrecord component.
-
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 aSimpleParticle2Drecord class.- Parameters:
texture- the value for thetexturerecord componentposition- the value for thepositionrecord componentvelocity- the value for thevelocityrecord componentgravity- the value for thegravityrecord componentsize- the value for thesizerecord componentlifetime- the value for thelifetimerecord component
-
-
Method Details
-
render
public void render(InstancedParticle2D instance, net.minecraft.client.gui.GuiGraphics graphics, float partialTick) Description copied from interface:IParticle2DRenders this particle using the providedGuiGraphics.- Specified by:
renderin interfaceIParticle2D- Parameters:
instance- TheInstancedParticle2Dto render.graphics- The graphics to draw using.partialTick- The game's partial tick.
-
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 '=='. -
texture
public net.minecraft.resources.ResourceLocation texture()Returns the value of thetexturerecord component.- Specified by:
texturein interfaceIParticle2D- Returns:
- the value of the
texturerecord component
-
position
public org.joml.Vector2f position()Returns the value of thepositionrecord component.- Specified by:
positionin interfaceIParticle2D- Returns:
- the value of the
positionrecord component
-
velocity
public org.joml.Vector2f velocity()Returns the value of thevelocityrecord component.- Returns:
- the value of the
velocityrecord component
-
gravity
public org.joml.Vector2f gravity()Returns the value of thegravityrecord component.- Returns:
- the value of the
gravityrecord component
-
size
public org.joml.Vector2i size()Returns the value of thesizerecord component.- Specified by:
sizein interfaceIParticle2D- Returns:
- the value of the
sizerecord component
-
lifetime
public int lifetime()Returns the value of thelifetimerecord component.- Specified by:
lifetimein interfaceIParticle2D- Returns:
- the value of the
lifetimerecord component
-