Class LocalHologramProvider<T>
java.lang.Object
io.github.projectunified.unihologram.api.local.LocalHologramProvider<T>
- Type Parameters:
T- the type of the location
- All Implemented Interfaces:
HologramProvider<T>
- Direct Known Subclasses:
FoliaHologramProvider,HDHologramProvider,VanillaHologramProvider
A hologram provider that stores created holograms
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateHologram(@NotNull String name, T location) Create a new hologramGet all hologramsgetHologram(@NotNull String name) Get a hologram by its namenewHologram(@NotNull String name, T location, @NotNull Consumer<Hologram<T>> onCreate, @NotNull Runnable onDestroy) Make a new hologram
-
Constructor Details
-
LocalHologramProvider
public LocalHologramProvider()
-
-
Method Details
-
newHologram
@NotNull protected abstract @NotNull Hologram<T> newHologram(@NotNull @NotNull String name, @NotNull T location, @NotNull @NotNull Consumer<Hologram<T>> onCreate, @NotNull @NotNull Runnable onDestroy) Make a new hologram- Parameters:
name- the name of the hologramlocation- the location of the hologramonCreate- the action to run when the hologram is createdonDestroy- the action to run when the hologram is destroyed- Returns:
- the hologram
-
createHologram
@NotNull public final @NotNull Hologram<T> createHologram(@NotNull @NotNull String name, @NotNull T location) Create a new hologram- Specified by:
createHologramin interfaceHologramProvider<T>- Parameters:
name- the name of the hologramlocation- the location of the hologram- Returns:
- the hologram
-
getHologram
Get a hologram by its name- Specified by:
getHologramin interfaceHologramProvider<T>- Parameters:
name- the name of the hologram- Returns:
- the hologram
-
getAllHolograms
Description copied from interface:HologramProviderGet all holograms- Specified by:
getAllHologramsin interfaceHologramProvider<T>- Returns:
- the collection of holograms
-