Klasse Hologram

java.lang.Object
de.oliver.fancyholograms.api.Hologram

public abstract class Hologram extends Object
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

    Felder
    Modifizierer und Typ
    Feld
    Beschreibung
    protected final @NotNull HologramData
     
    static final int
     
    protected static final int
     
    protected final @NotNull Set<UUID>
    Set of UUIDs of players to whom the hologram is currently shown.
    static final net.kyori.adventure.text.format.TextColor
     
  • Konstruktorübersicht

    Konstruktoren
    Modifizierer
    Konstruktor
    Beschreibung
    protected
    Hologram(@NotNull HologramData data)
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    void
    checkAndUpdateShownStateForPlayer(org.bukkit.entity.Player player)
    Checks and updates the shown state for a player.
    protected abstract void
     
    final void
     
    protected abstract void
     
    final void
     
    final boolean
    equals(@Nullable Object o)
     
    final @NotNull HologramData
     
    abstract @Nullable org.bukkit.entity.Display
    Returns the Display entity of this Hologram object.
    final net.kyori.adventure.text.Component
    getShownText(@Nullable org.bukkit.entity.Player player)
    Gets the text shown in the hologram.
    final @NotNull @UnmodifiableView Set<UUID>
     
    final int
     
    protected abstract boolean
    hide(@NotNull org.bukkit.entity.Player player)
     
    final void
    hideHologram(Collection<? extends org.bukkit.entity.Player> players)
    Must be called asynchronously
    final void
    hideHologram(org.bukkit.entity.Player player)
    Must be called asynchronously
    final boolean
    isShown(@NotNull UUID player)
     
    final boolean
    isShown(@NotNull org.bukkit.entity.Player player)
     
    protected abstract void
    refresh(@NotNull org.bukkit.entity.Player player)
     
    final void
    refreshHologram(@NotNull Collection<? extends org.bukkit.entity.Player> players)
     
    final void
    refreshHologram(@NotNull org.bukkit.entity.Player player)
    Refreshes the hologram for the specified player by resending its location and entity data
    protected boolean
    shouldHologramBeShown(@NotNull org.bukkit.entity.Player player)
     
    protected abstract boolean
    show(@NotNull org.bukkit.entity.Player player)
     
    final void
    showHologram(Collection<? extends org.bukkit.entity.Player> players)
    Must be called asynchronously
    final void
    showHologram(org.bukkit.entity.Player player)
    Must be called asynchronously
    protected abstract void
     
    final void
     

    Von Klasse geerbte Methoden java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Felddetails

    • LINE_WIDTH

      public static final int LINE_WIDTH
      Siehe auch:
    • TRANSPARENT

      public static final net.kyori.adventure.text.format.TextColor TRANSPARENT
    • MINIMUM_PROTOCOL_VERSION

      protected static final int MINIMUM_PROTOCOL_VERSION
      Siehe auch:
    • data

      @NotNull protected final @NotNull HologramData data
    • shown

      @NotNull protected final @NotNull Set<UUID> shown
      Set of UUIDs of players to whom the hologram is currently shown.
  • Konstruktordetails

    • Hologram

      protected Hologram(@NotNull @NotNull HologramData data)
  • Methodendetails

    • getData

      @NotNull public final @NotNull HologramData 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

      public final void showHologram(org.bukkit.entity.Player player)
      Must be called asynchronously
    • showHologram

      public final void showHologram(Collection<? extends org.bukkit.entity.Player> players)
      Must be called asynchronously
    • hideHologram

      public final void hideHologram(org.bukkit.entity.Player player)
      Must be called asynchronously
    • hideHologram

      public final void hideHologram(Collection<? extends org.bukkit.entity.Player> players)
      Must be called asynchronously
    • updateHologram

      public final void updateHologram()
    • 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)
    • getShownToPlayers

      @NotNull public final @NotNull @UnmodifiableView Set<UUID> getShownToPlayers()
    • isShown

      public final boolean isShown(@NotNull @NotNull UUID player)
    • isShown

      public final boolean isShown(@NotNull @NotNull org.bukkit.entity.Player player)
    • shouldHologramBeShown

      protected boolean shouldHologramBeShown(@NotNull @NotNull org.bukkit.entity.Player player)
    • checkAndUpdateShownStateForPlayer

      public void checkAndUpdateShownStateForPlayer(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
    • 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

      public final boolean equals(@Nullable @Nullable Object o)
      Setzt außer Kraft:
      equals in Klasse Object
    • hashCode

      public final int hashCode()
      Setzt außer Kraft:
      hashCode in Klasse Object