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
ConstructorDescriptionDHHologram
(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 TypeMethodDescriptionvoid
addLine
(int page, @NotNull HologramLine line) Add a line to the hologramvoid
clear()
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.Location
Get the location of the hologramgetName()
Get the name of the hologramint
getPage
(org.bukkit.entity.Player viewer) Get the current page of the viewerint
getPages()
Get the amount of pagesvoid
hideAll()
Hide the hologram from all viewersvoid
hideTo
(org.bukkit.entity.Player viewer) Hide the hologram from the viewervoid
init()
Initialize the hologram.void
insertLine
(int page, int index, @NotNull HologramLine line) Insert a line to the hologram at the index and move the rest downboolean
Check if the hologram is initializedboolean
isVisible
(org.bukkit.entity.Player viewer) Check if the viewer can see the hologramvoid
removeLine
(int page, int index) Remove a line at the index from the hologramvoid
setLine
(int page, int index, @NotNull HologramLine line) Set the line at the index to the new linevoid
setLines
(int page, @NotNull List<HologramLine> lines) Set the lines of the hologramvoid
setLocation
(org.bukkit.Location location) Set the location of the hologramvoid
setPage
(org.bukkit.entity.Player viewer, int page) Change the page for the viewer.void
showAll()
Show the hologram to all viewersvoid
showTo
(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, wait
Methods inherited from interface io.github.projectunified.unihologram.api.paged.PagedHologram
addLine, getFirstPage, getLine, getLines, insertLine, removeLine, setLine, setLines, size, size
Methods 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:PagedHologram
Get the amount of pages- Specified by:
getPages
in interfacePagedHologram<org.bukkit.Location>
- Returns:
- the amount
-
getLines
Description copied from interface:PagedHologram
Get the lines of the hologram- Specified by:
getLines
in interfacePagedHologram<org.bukkit.Location>
- Parameters:
page
- the page- Returns:
- the lines
-
setLines
Description copied from interface:PagedHologram
Set the lines of the hologram- Specified by:
setLines
in interfacePagedHologram<org.bukkit.Location>
- Parameters:
page
- the pagelines
- the lines
-
addLine
Description copied from interface:PagedHologram
Add a line to the hologram- Specified by:
addLine
in interfacePagedHologram<org.bukkit.Location>
- Parameters:
page
- the pageline
- the line
-
insertLine
Description copied from interface:PagedHologram
Insert a line to the hologram at the index and move the rest down- Specified by:
insertLine
in interfacePagedHologram<org.bukkit.Location>
- Parameters:
page
- the pageindex
- the indexline
- the line
-
setLine
Description copied from interface:PagedHologram
Set the line at the index to the new line- Specified by:
setLine
in 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:PagedHologram
Remove a line at the index from the hologram- Specified by:
removeLine
in interfacePagedHologram<org.bukkit.Location>
- Parameters:
page
- the pageindex
- the index
-
getLine
Description copied from interface:PagedHologram
Get the line at the index- Specified by:
getLine
in interfacePagedHologram<org.bukkit.Location>
- Parameters:
page
- the pageindex
- the index- Returns:
- the line
-
getName
Description copied from interface:Hologram
Get the name of the hologram -
init
public void init()Description copied from interface:Hologram
Initialize the hologram. Call this before using the hologram. -
clear
public void clear()Description copied from interface:Hologram
Clear the hologram -
isInitialized
public boolean isInitialized()Description copied from interface:Hologram
Check if the hologram is initialized- Specified by:
isInitialized
in interfaceHologram<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 interfaceHologram<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 interfaceHologram<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 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:Visibility
Show the hologram to all viewers- Specified by:
showAll
in interfaceVisibility<org.bukkit.entity.Player>
-
hideAll
public void hideAll()Description copied from interface:Visibility
Hide the hologram from all viewers- Specified by:
hideAll
in interfaceVisibility<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 interfaceVisibility<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 interfaceVisibility<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 interfaceViewerPage<org.bukkit.entity.Player>
- Parameters:
viewer
- the viewerpage
- 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 interfaceViewerPage<org.bukkit.entity.Player>
- Parameters:
viewer
- the viewer- Returns:
- the current page
-