Class Renderers.ItemDisplayRenderer

java.lang.Object
com.github.darksoulq.abyssallib.world.particle.impl.Renderers.ItemDisplayRenderer
All Implemented Interfaces:
ParticleRenderer
Enclosing class:
Renderers

public static class Renderers.ItemDisplayRenderer extends Object implements ParticleRenderer
A high-performance renderer that uses ItemDisplay entities.

Instead of spawning particles every tick, this renderer manages a pool of entities and updates their transformations. This allows for complex 3D models to be part of an effect with minimal network overhead.

  • Constructor Summary

    Constructors
    Constructor
    Description
    ItemDisplayRenderer(org.bukkit.inventory.ItemStack item, float scale, org.bukkit.entity.Display.Billboard billboard)
    Constructs a new ItemDisplayRenderer.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    render(org.bukkit.Location center, List<org.bukkit.util.Vector> points, List<org.bukkit.entity.Player> players)
    Manages the entity pool and updates transformations.
    void
    Removes all entities in the pool and clears the list.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface ParticleRenderer

    start
  • Constructor Details

    • ItemDisplayRenderer

      public ItemDisplayRenderer(org.bukkit.inventory.ItemStack item, float scale, org.bukkit.entity.Display.Billboard billboard)
      Constructs a new ItemDisplayRenderer.
      Parameters:
      item - The ItemStack to display.
      scale - The uniform scale of the items.
      billboard - The Display.Billboard mode.
  • Method Details

    • render

      public void render(org.bukkit.Location center, List<org.bukkit.util.Vector> points, List<org.bukkit.entity.Player> players)
      Manages the entity pool and updates transformations.

      Automatically spawns new entities if the point count increases and cleans up excess entities if it decreases.

      Specified by:
      render in interface ParticleRenderer
      Parameters:
      center - The origin location.
      points - The target coordinates for the displays.
      players - The players who are allowed to see these entities.
    • stop

      public void stop()
      Removes all entities in the pool and clears the list.
      Specified by:
      stop in interface ParticleRenderer