Klasse Hologram
java.lang.Object
de.oliver.fancyholograms.api.hologram.Hologram
Abstract base class for creating, updating, and managing holograms.
This class provides the basic functionality needed to work with holograms across multiple versions of Minecraft. To create a hologram specific to a version of Minecraft, extend this class and implement the abstract methods.
Note that the specific way holograms are created, updated, and deleted will vary depending on the Minecraft version.
A Hologram object includes data about the hologram and maintains a set of players to whom the hologram is shown.
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprotected final @NotNull HologramDatastatic final intprotected static final intstatic final org.bukkit.ColorSet of UUIDs of players to whom the hologram is currently shown. -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected abstract voidcreate()final voidprotected abstract voiddelete()final voidfinal booleanfinal voidforceHideHologram(org.bukkit.entity.Player player) final voidforceShowHologram(org.bukkit.entity.Player player) final voidForces hologram to update and refresh for playersvoidforceUpdateShownStateFor(org.bukkit.entity.Player player) Checks and forcefully updates the shown state for a player.final @NotNull HologramDatagetData()abstract @Nullable org.bukkit.entity.DisplayReturns the Display entity of this Hologram object.@NotNull StringgetName()final net.kyori.adventure.text.ComponentgetShownText(@Nullable org.bukkit.entity.Player player) Gets the text shown in the hologram.final inthashCode()protected abstract booleanhide(@NotNull org.bukkit.entity.Player player) final voidhideHologram(Collection<? extends org.bukkit.entity.Player> players) final voidhideHologram(org.bukkit.entity.Player player) final booleanfinal booleanisViewer(@NotNull org.bukkit.entity.Player player) final voidQueues hologram to update and refresh for playersprotected abstract voidrefresh(@NotNull org.bukkit.entity.Player player) voidRefreshes the hologram for the players it is currently shown to.voidRefreshes the hologram for players in the world associated with the hologram's location.final voidrefreshHologram(@NotNull Collection<? extends org.bukkit.entity.Player> players) final voidrefreshHologram(@NotNull org.bukkit.entity.Player player) Refreshes the hologram for the specified player by resending its location and entity dataprotected booleanshouldShowTo(@NotNull org.bukkit.entity.Player player) protected abstract booleanshow(@NotNull org.bukkit.entity.Player player) final voidshowHologram(Collection<? extends org.bukkit.entity.Player> players) final voidshowHologram(org.bukkit.entity.Player player) protected abstract voidupdate()final voidVeraltet, zur Entfernung: Dieses API-Element wird in einer zukünftigen Version entfernt.voidupdateShownStateFor(org.bukkit.entity.Player player) Checks and updates the shown state for a player.
-
Felddetails
-
LINE_WIDTH
public static final int LINE_WIDTH- Siehe auch:
-
TRANSPARENT
public static final org.bukkit.Color TRANSPARENT -
MINIMUM_PROTOCOL_VERSION
protected static final int MINIMUM_PROTOCOL_VERSION- Siehe auch:
-
data
-
viewers
Set of UUIDs of players to whom the hologram is currently shown.
-
-
Konstruktordetails
-
Hologram
-
-
Methodendetails
-
getName
-
getData
-
getDisplayEntity
@Nullable public abstract @Nullable org.bukkit.entity.Display getDisplayEntity()Returns the Display entity of this Hologram object. The entity is not registered in the world or server. Only use this method if you know what you're doing.- Gibt zurück:
- the Display entity of this Hologram object
-
create
protected abstract void create() -
delete
protected abstract void delete() -
update
protected abstract void update() -
show
protected abstract boolean show(@NotNull @NotNull org.bukkit.entity.Player player) -
hide
protected abstract boolean hide(@NotNull @NotNull org.bukkit.entity.Player player) -
refresh
protected abstract void refresh(@NotNull @NotNull org.bukkit.entity.Player player) -
createHologram
public final void createHologram() -
deleteHologram
public final void deleteHologram() -
showHologram
-
showHologram
public final void showHologram(org.bukkit.entity.Player player) -
forceShowHologram
public final void forceShowHologram(org.bukkit.entity.Player player) -
hideHologram
-
hideHologram
public final void hideHologram(org.bukkit.entity.Player player) -
forceHideHologram
public final void forceHideHologram(org.bukkit.entity.Player player) -
updateHologram
Veraltet, zur Entfernung: Dieses API-Element wird in einer zukünftigen Version entfernt. -
queueUpdate
public final void queueUpdate()Queues hologram to update and refresh for players -
forceUpdate
public final void forceUpdate()Forces hologram to update and refresh for players -
refreshForViewers
public void refreshForViewers()Refreshes the hologram for the players it is currently shown to. -
refreshForViewersInWorld
public void refreshForViewersInWorld()Refreshes the hologram for players in the world associated with the hologram's location. -
refreshHologram
public final void refreshHologram(@NotNull @NotNull org.bukkit.entity.Player player) Refreshes the hologram for the specified player by resending its location and entity data- Parameter:
player- the player to refresh the hologram for
-
refreshHologram
public final void refreshHologram(@NotNull @NotNull Collection<? extends org.bukkit.entity.Player> players) -
getViewers
-
isViewer
public final boolean isViewer(@NotNull @NotNull org.bukkit.entity.Player player) -
isViewer
-
shouldShowTo
protected boolean shouldShowTo(@NotNull @NotNull org.bukkit.entity.Player player) -
updateShownStateFor
public void updateShownStateFor(org.bukkit.entity.Player player) Checks and updates the shown state for a player. If the hologram is shown and should not be, it hides it. If the hologram is not shown and should be, it shows it.- Parameter:
player- the player to check and update the shown state for
-
forceUpdateShownStateFor
public void forceUpdateShownStateFor(org.bukkit.entity.Player player) Checks and forcefully updates the shown state for a player. If the hologram is shown and should not be, it hides it. If the hologram is not shown and should be, it shows it.- Parameter:
player- the player to check and update the shown state for
-
getShownText
public final net.kyori.adventure.text.Component getShownText(@Nullable @Nullable org.bukkit.entity.Player player) Gets the text shown in the hologram. If a player is specified, placeholders in the text are replaced with their corresponding values for the player.- Parameter:
player- the player to get the placeholders for, or null if no placeholders should be replaced- Gibt zurück:
- the text shown in the hologram
-
equals
-
hashCode
public final int hashCode()
-