Class Particle

java.lang.Object
hm.zelha.particlesfx.particles.parents.Particle
All Implemented Interfaces:
IParticle
Direct Known Subclasses:
ParticleAngry, ParticleAsh, ParticleAshWhite, ParticleBlockBreak, ParticleBlockCrumble, ParticleBlockDust, ParticleBlockMarker, ParticleCherryLeaves, ParticleCrimsonSpore, ParticleCurrentDown, ParticleDustColored, ParticleEffect, ParticleEffectColored, ParticleEnderSignal, ParticleExplosion, ParticleExplosionEmitter, ParticleFlash, ParticleGlow, ParticleGust, ParticleGustEmitterLarge, ParticleGustEmitterSmall, ParticleGustSmall, ParticleHappy, ParticleHeart, ParticleHoney, ParticleInfested, ParticleInstantEffect, ParticleLava, ParticleLavaPop, ParticleMycelium, ParticleNectar, ParticleNote, ParticleNull, ParticleObsidianTear, ParticleOmenRaid, ParticleOmenTrial, ParticlePaleOakLeaves, ParticleShriek, ParticleSonicBoom, ParticleSplash, ParticleSporeBlossom, ParticleSweepAttack, ParticleUnderwater, ParticleWarpedSpore, ParticleWater, ParticleWitch, TravellingParticle

public abstract class Particle extends Object implements IParticle
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
     
    protected final org.bukkit.util.Vector
     
    protected final org.bukkit.util.Vector
     
    protected double
     
    protected double
     
    protected double
     
    protected net.minecraft.core.particles.ParticleParam
     
    protected int
     
    protected final ThreadLocalRandom
     
    protected double
     
    protected final org.bukkit.util.Vector
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Particle(String particleID, double offsetX, double offsetY, double offsetZ, int count)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract Particle
     
    void
    display(org.bukkit.Location location)
     
    protected void
    display(org.bukkit.Location location, List<org.bukkit.craftbukkit.v1_21_R3.entity.CraftPlayer> players)
     
    void
    displayForPlayers(org.bukkit.Location location, List<UUID> players)
     
    void
    displayForPlayers(org.bukkit.Location location, org.bukkit.entity.Player... players)
     
    protected org.bukkit.util.Vector
     
    int
     
    protected org.bukkit.util.Vector
    getOffsets(org.bukkit.Location location)
    Meant to be overridden by child classes to modify the offset values of the packet sent to the player.
    double
     
    double
     
    double
     
    protected int
    Meant to be overridden by child classes to modify the count value of the packet sent to the player.
    protected float
    Meant to be overridden by child classes to modify the speed value of the packet sent to the player.
    int
     
    double
     
    protected net.minecraft.network.protocol.Packet
    getStrangePacket(org.bukkit.Location location)
    Meant to be overridden by child classes when a different packet is needed to display the particle.
    protected org.bukkit.util.Vector
    getXYZ(org.bukkit.Location location)
    Meant to be overridden by child classes to modify the X/Y/Z values of the packet sent to the player.
    inherit(Particle particle)
     
    void
    setCount(int count)
     
    void
    setOffset(double x, double y, double z)
     
    void
    setOffsetX(double offsetX)
     
    void
    setOffsetY(double offsetY)
     
    void
    setOffsetZ(double offsetZ)
     
    setRadius(int radius)
     
    setSpeed(double speed)
     

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • rng

      protected final ThreadLocalRandom rng
    • fakeOffsetHelper

      protected final org.bukkit.util.Vector fakeOffsetHelper
    • xyzHelper

      protected final org.bukkit.util.Vector xyzHelper
    • offsetHelper

      protected final org.bukkit.util.Vector offsetHelper
    • particle

      protected net.minecraft.core.particles.ParticleParam particle
    • offsetX

      protected double offsetX
    • offsetY

      protected double offsetY
    • offsetZ

      protected double offsetZ
    • speed

      protected double speed
    • count

      protected int count
    • radius

      protected int radius
  • Constructor Details

    • Particle

      protected Particle(String particleID, double offsetX, double offsetY, double offsetZ, int count)
  • Method Details

    • display

      public void display(org.bukkit.Location location)
      Specified by:
      display in interface IParticle
    • displayForPlayers

      public void displayForPlayers(org.bukkit.Location location, org.bukkit.entity.Player... players)
      Specified by:
      displayForPlayers in interface IParticle
    • displayForPlayers

      public void displayForPlayers(org.bukkit.Location location, List<UUID> players)
      Specified by:
      displayForPlayers in interface IParticle
    • inherit

      public Particle inherit(Particle particle)
      Specified by:
      inherit in interface IParticle
      Parameters:
      particle - particle for this object to copy data from
      Returns:
      this object
    • clone

      public abstract Particle clone()
      Specified by:
      clone in interface IParticle
      Overrides:
      clone in class Object
    • display

      protected void display(org.bukkit.Location location, List<org.bukkit.craftbukkit.v1_21_R3.entity.CraftPlayer> players)
    • generateFakeOffset

      protected org.bukkit.util.Vector generateFakeOffset()
      Returns:
      a vector meant to be added to a location to mimic particle offset
    • getXYZ

      protected org.bukkit.util.Vector getXYZ(org.bukkit.Location location)
      Meant to be overridden by child classes to modify the X/Y/Z values of the packet sent to the player.
      Parameters:
      location - the location passed into the display method
      Returns:
      the xyzHelper with the modified X/Y/Z values
    • getOffsets

      protected org.bukkit.util.Vector getOffsets(org.bukkit.Location location)
      Meant to be overridden by child classes to modify the offset values of the packet sent to the player.
      Parameters:
      location - the location passed into the display method
      Returns:
      the offsetHelper with the modified offset values
    • getPacketSpeed

      protected float getPacketSpeed()
      Meant to be overridden by child classes to modify the speed value of the packet sent to the player.
      Returns:
      the modified speed value
    • getPacketCount

      protected int getPacketCount()
      Meant to be overridden by child classes to modify the count value of the packet sent to the player.
      Returns:
      the modified count value
    • getStrangePacket

      protected net.minecraft.network.protocol.Packet getStrangePacket(org.bukkit.Location location)
      Meant to be overridden by child classes when a different packet is needed to display the particle.
      Parameters:
      location - the location passed into the display method
      Returns:
      the different packet
    • setOffset

      public void setOffset(double x, double y, double z)
      Specified by:
      setOffset in interface IParticle
    • setOffsetX

      public void setOffsetX(double offsetX)
      Specified by:
      setOffsetX in interface IParticle
    • setOffsetY

      public void setOffsetY(double offsetY)
      Specified by:
      setOffsetY in interface IParticle
    • setOffsetZ

      public void setOffsetZ(double offsetZ)
      Specified by:
      setOffsetZ in interface IParticle
    • setSpeed

      public Particle setSpeed(double speed)
      Specified by:
      setSpeed in interface IParticle
    • setCount

      public void setCount(int count)
      Specified by:
      setCount in interface IParticle
    • setRadius

      public Particle setRadius(int radius)
      Specified by:
      setRadius in interface IParticle
    • getOffsetX

      public double getOffsetX()
      Specified by:
      getOffsetX in interface IParticle
    • getOffsetY

      public double getOffsetY()
      Specified by:
      getOffsetY in interface IParticle
    • getOffsetZ

      public double getOffsetZ()
      Specified by:
      getOffsetZ in interface IParticle
    • getSpeed

      public double getSpeed()
      Specified by:
      getSpeed in interface IParticle
    • getCount

      public int getCount()
      Specified by:
      getCount in interface IParticle
    • getRadius

      public int getRadius()
      Specified by:
      getRadius in interface IParticle