Class SimpleHologram<T>

java.lang.Object
io.github.projectunified.unihologram.api.simple.SimpleHologram<T>
Type Parameters:
T - the type of the location
All Implemented Interfaces:
Hologram<T>
Direct Known Subclasses:
FoliaHologram, VanillaHologram

public abstract class SimpleHologram<T> extends Object implements Hologram<T>
A simple hologram for features that only support updating the whole hologram
  • Field Details

    • lines

      protected List<HologramLine> lines
      The current lines
    • name

      protected String name
      The name of the hologram
    • location

      protected T location
      The location of the hologram
  • Constructor Details

    • SimpleHologram

      protected SimpleHologram(String name, T location)
  • Method Details

    • updateHologram

      protected abstract void updateHologram()
      Update the hologram
    • initHologram

      protected abstract void initHologram()
      Initialize the hologram
    • clearHologram

      protected abstract void clearHologram()
      Clear the hologram
    • getLines

      @NotNull public @NotNull List<HologramLine> getLines()
      Description copied from interface: Hologram
      Get the lines of the hologram
      Specified by:
      getLines in interface Hologram<T>
      Returns:
      the lines
    • setLines

      public void setLines(@NotNull @NotNull List<HologramLine> lines)
      Description copied from interface: Hologram
      Set the lines of the hologram
      Specified by:
      setLines in interface Hologram<T>
      Parameters:
      lines - the lines
    • addLine

      public void addLine(@NotNull @NotNull HologramLine line)
      Description copied from interface: Hologram
      Add a line to the hologram
      Specified by:
      addLine in interface Hologram<T>
      Parameters:
      line - the line
    • setLine

      public void setLine(int index, @NotNull @NotNull HologramLine line)
      Description copied from interface: Hologram
      Set the line at the index to the new line
      Specified by:
      setLine in interface Hologram<T>
      Parameters:
      index - the index
      line - the new line
    • insertLine

      public void insertLine(int index, @NotNull @NotNull HologramLine line)
      Description copied from interface: Hologram
      Insert a line to the hologram at the index and move the rest down
      Specified by:
      insertLine in interface Hologram<T>
      Parameters:
      index - the index
      line - the line
    • removeLine

      public void removeLine(int index)
      Description copied from interface: Hologram
      Remove a line at the index from the hologram
      Specified by:
      removeLine in interface Hologram<T>
      Parameters:
      index - the index
    • getName

      public String getName()
      Description copied from interface: Hologram
      Get the name of the hologram
      Specified by:
      getName in interface Hologram<T>
      Returns:
      the name
    • init

      public void init()
      Description copied from interface: Hologram
      Initialize the hologram. Call this before using the hologram.
      Specified by:
      init in interface Hologram<T>
    • clear

      public void clear()
      Description copied from interface: Hologram
      Clear the hologram
      Specified by:
      clear in interface Hologram<T>
    • isInitialized

      public boolean isInitialized()
      Description copied from interface: Hologram
      Check if the hologram is initialized
      Specified by:
      isInitialized in interface Hologram<T>
      Returns:
      true if it is
    • getLocation

      public T getLocation()
      Description copied from interface: Hologram
      Get the location of the hologram
      Specified by:
      getLocation in interface Hologram<T>
      Returns:
      the location
    • setLocation

      public void setLocation(T location)
      Description copied from interface: Hologram
      Set the location of the hologram
      Specified by:
      setLocation in interface Hologram<T>
      Parameters:
      location - the location