Class DHHologram
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 Summary
ConstructorsConstructorDescriptionDHHologram(eu.decentsoftware.holograms.api.holograms.Hologram hologram) Create a new hologramDHHologram(String name, org.bukkit.Location location) Create a new hologram -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLine(int page, @NotNull HologramLine line) Add a line to the hologramvoidclear()Clear the hologramgetLine(int page, int index) Get the line at the index@NotNull List<HologramLine>getLines(int page) Get the lines of the hologramorg.bukkit.LocationGet the location of the hologramgetName()Get the name of the hologramintgetPage(org.bukkit.entity.Player viewer) Get the current page of the viewerintgetPages()Get the amount of pagesvoidhideAll()Hide the hologram from all viewersvoidhideTo(org.bukkit.entity.Player viewer) Hide the hologram from the viewervoidinit()Initialize the hologram.voidinsertLine(int page, int index, @NotNull HologramLine line) Insert a line to the hologram at the index and move the rest downbooleanCheck if the hologram is initializedbooleanisVisible(org.bukkit.entity.Player viewer) Check if the viewer can see the hologramvoidremoveLine(int page, int index) Remove a line at the index from the hologramvoidsetLine(int page, int index, @NotNull HologramLine line) Set the line at the index to the new linevoidsetLines(int page, @NotNull List<HologramLine> lines) Set the lines of the hologramvoidsetLocation(org.bukkit.Location location) Set the location of the hologramvoidsetPage(org.bukkit.entity.Player viewer, int page) Change the page for the viewer.voidshowAll()Show the hologram to all viewersvoidshowTo(org.bukkit.entity.Player viewer) Show the hologram to the viewerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.projectunified.unihologram.api.paged.PagedHologram
addLine, getFirstPage, getLine, getLines, insertLine, removeLine, setLine, setLines, size, sizeMethods inherited from interface io.github.projectunified.unihologram.api.paged.ViewerPage
nextPage, previousPage
-
Constructor Details
-
DHHologram
Create a new hologram- Parameters:
name- the name of the hologramlocation- 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:PagedHologramGet the amount of pages- Specified by:
getPagesin interfacePagedHologram<org.bukkit.Location>- Returns:
- the amount
-
getLines
Description copied from interface:PagedHologramGet the lines of the hologram- Specified by:
getLinesin interfacePagedHologram<org.bukkit.Location>- Parameters:
page- the page- Returns:
- the lines
-
setLines
Description copied from interface:PagedHologramSet the lines of the hologram- Specified by:
setLinesin interfacePagedHologram<org.bukkit.Location>- Parameters:
page- the pagelines- the lines
-
addLine
Description copied from interface:PagedHologramAdd a line to the hologram- Specified by:
addLinein interfacePagedHologram<org.bukkit.Location>- Parameters:
page- the pageline- the line
-
insertLine
Description copied from interface:PagedHologramInsert a line to the hologram at the index and move the rest down- Specified by:
insertLinein interfacePagedHologram<org.bukkit.Location>- Parameters:
page- the pageindex- the indexline- the line
-
setLine
Description copied from interface:PagedHologramSet the line at the index to the new line- Specified by:
setLinein interfacePagedHologram<org.bukkit.Location>- Parameters:
page- the pageindex- the indexline- the new line
-
removeLine
public void removeLine(int page, int index) Description copied from interface:PagedHologramRemove a line at the index from the hologram- Specified by:
removeLinein interfacePagedHologram<org.bukkit.Location>- Parameters:
page- the pageindex- the index
-
getLine
Description copied from interface:PagedHologramGet the line at the index- Specified by:
getLinein interfacePagedHologram<org.bukkit.Location>- Parameters:
page- the pageindex- the index- Returns:
- the line
-
getName
Description copied from interface:HologramGet the name of the hologram -
init
public void init()Description copied from interface:HologramInitialize the hologram. Call this before using the hologram. -
clear
public void clear()Description copied from interface:HologramClear the hologram -
isInitialized
public boolean isInitialized()Description copied from interface:HologramCheck if the hologram is initialized- Specified by:
isInitializedin interfaceHologram<org.bukkit.Location>- Returns:
- true if it is
-
getLocation
public org.bukkit.Location getLocation()Description copied from interface:HologramGet the location of the hologram- Specified by:
getLocationin interfaceHologram<org.bukkit.Location>- Returns:
- the location
-
setLocation
public void setLocation(org.bukkit.Location location) Description copied from interface:HologramSet the location of the hologram- Specified by:
setLocationin interfaceHologram<org.bukkit.Location>- Parameters:
location- the location
-
isVisible
public boolean isVisible(org.bukkit.entity.Player viewer) Description copied from interface:VisibilityCheck if the viewer can see the hologram- Specified by:
isVisiblein interfaceVisibility<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:VisibilityShow the hologram to all viewers- Specified by:
showAllin interfaceVisibility<org.bukkit.entity.Player>
-
hideAll
public void hideAll()Description copied from interface:VisibilityHide the hologram from all viewers- Specified by:
hideAllin interfaceVisibility<org.bukkit.entity.Player>
-
showTo
public void showTo(org.bukkit.entity.Player viewer) Description copied from interface:VisibilityShow the hologram to the viewer- Specified by:
showToin interfaceVisibility<org.bukkit.entity.Player>- Parameters:
viewer- the viewer
-
hideTo
public void hideTo(org.bukkit.entity.Player viewer) Description copied from interface:VisibilityHide the hologram from the viewer- Specified by:
hideToin interfaceVisibility<org.bukkit.entity.Player>- Parameters:
viewer- the viewer
-
setPage
public void setPage(org.bukkit.entity.Player viewer, int page) Description copied from interface:ViewerPageChange 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:
setPagein interfaceViewerPage<org.bukkit.entity.Player>- Parameters:
viewer- the viewerpage- the page
-
getPage
public int getPage(org.bukkit.entity.Player viewer) Description copied from interface:ViewerPageGet the current page of the viewer- Specified by:
getPagein interfaceViewerPage<org.bukkit.entity.Player>- Parameters:
viewer- the viewer- Returns:
- the current page
-