java.lang.Object
io.github.projectunified.unihologram.spigot.decentholograms.DHHologram
All Implemented Interfaces:
Hologram<org.bukkit.Location>, PagedHologram<org.bukkit.Location>, ViewerPage<org.bukkit.entity.Player>, Visibility<org.bukkit.entity.Player>, PlayerPage, PlayerVisibility

public class DHHologram extends Object implements PagedHologram<org.bukkit.Location>, PlayerPage, PlayerVisibility
The hologram for DecentHolograms
  • Constructor Details

    • DHHologram

      public DHHologram(String name, org.bukkit.Location location)
      Create a new hologram
      Parameters:
      name - the name of the hologram
      location - the location of the hologram
    • DHHologram

      public DHHologram(eu.decentsoftware.holograms.api.holograms.Hologram hologram)
      Create a new hologram
      Parameters:
      hologram - the hologram
  • Method Details

    • getPages

      public int getPages()
      Description copied from interface: PagedHologram
      Get the amount of pages
      Specified by:
      getPages in interface PagedHologram<org.bukkit.Location>
      Returns:
      the amount
    • getLines

      @NotNull public @NotNull List<HologramLine> getLines(int page)
      Description copied from interface: PagedHologram
      Get the lines of the hologram
      Specified by:
      getLines in interface PagedHologram<org.bukkit.Location>
      Parameters:
      page - the page
      Returns:
      the lines
    • setLines

      public void setLines(int page, @NotNull @NotNull List<HologramLine> lines)
      Description copied from interface: PagedHologram
      Set the lines of the hologram
      Specified by:
      setLines in interface PagedHologram<org.bukkit.Location>
      Parameters:
      page - the page
      lines - the lines
    • addLine

      public void addLine(int page, @NotNull @NotNull HologramLine line)
      Description copied from interface: PagedHologram
      Add a line to the hologram
      Specified by:
      addLine in interface PagedHologram<org.bukkit.Location>
      Parameters:
      page - the page
      line - the line
    • insertLine

      public void insertLine(int page, int index, @NotNull @NotNull HologramLine line)
      Description copied from interface: PagedHologram
      Insert a line to the hologram at the index and move the rest down
      Specified by:
      insertLine in interface PagedHologram<org.bukkit.Location>
      Parameters:
      page - the page
      index - the index
      line - the line
    • setLine

      public void setLine(int page, int index, @NotNull @NotNull HologramLine line)
      Description copied from interface: PagedHologram
      Set the line at the index to the new line
      Specified by:
      setLine in interface PagedHologram<org.bukkit.Location>
      Parameters:
      page - the page
      index - the index
      line - the new line
    • removeLine

      public void removeLine(int page, int index)
      Description copied from interface: PagedHologram
      Remove a line at the index from the hologram
      Specified by:
      removeLine in interface PagedHologram<org.bukkit.Location>
      Parameters:
      page - the page
      index - the index
    • getLine

      public Optional<HologramLine> getLine(int page, int index)
      Description copied from interface: PagedHologram
      Get the line at the index
      Specified by:
      getLine in interface PagedHologram<org.bukkit.Location>
      Parameters:
      page - the page
      index - the index
      Returns:
      the line
    • getName

      public String getName()
      Description copied from interface: Hologram
      Get the name of the hologram
      Specified by:
      getName in interface Hologram<org.bukkit.Location>
      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<org.bukkit.Location>
    • clear

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

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

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

      public void setLocation(org.bukkit.Location location)
      Description copied from interface: Hologram
      Set the location of the hologram
      Specified by:
      setLocation in interface Hologram<org.bukkit.Location>
      Parameters:
      location - the location
    • isVisible

      public boolean isVisible(org.bukkit.entity.Player viewer)
      Description copied from interface: Visibility
      Check if the viewer can see the hologram
      Specified by:
      isVisible in interface Visibility<org.bukkit.entity.Player>
      Parameters:
      viewer - the viewer
      Returns:
      true if the viewer can see the hologram
    • showAll

      public void showAll()
      Description copied from interface: Visibility
      Show the hologram to all viewers
      Specified by:
      showAll in interface Visibility<org.bukkit.entity.Player>
    • hideAll

      public void hideAll()
      Description copied from interface: Visibility
      Hide the hologram from all viewers
      Specified by:
      hideAll in interface Visibility<org.bukkit.entity.Player>
    • showTo

      public void showTo(org.bukkit.entity.Player viewer)
      Description copied from interface: Visibility
      Show the hologram to the viewer
      Specified by:
      showTo in interface Visibility<org.bukkit.entity.Player>
      Parameters:
      viewer - the viewer
    • hideTo

      public void hideTo(org.bukkit.entity.Player viewer)
      Description copied from interface: Visibility
      Hide the hologram from the viewer
      Specified by:
      hideTo in interface Visibility<org.bukkit.entity.Player>
      Parameters:
      viewer - the viewer
    • setPage

      public void setPage(org.bukkit.entity.Player viewer, int page)
      Description copied from interface: ViewerPage
      Change the page for the viewer. Implementations should check if the page is valid, and if not, change it to the closest valid page, or limit the page range from 0 to the maximum page (inclusive).
      Specified by:
      setPage in interface ViewerPage<org.bukkit.entity.Player>
      Parameters:
      viewer - the viewer
      page - the page
    • getPage

      public int getPage(org.bukkit.entity.Player viewer)
      Description copied from interface: ViewerPage
      Get the current page of the viewer
      Specified by:
      getPage in interface ViewerPage<org.bukkit.entity.Player>
      Parameters:
      viewer - the viewer
      Returns:
      the current page