Package de.oliver.fancyholograms.api
Klasse Hologram
java.lang.Object
de.oliver.fancyholograms.api.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 intSet of UUIDs of players to whom the hologram is currently shown.static final net.kyori.adventure.text.format.TextColor -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidcheckAndUpdateShownStateForPlayer(org.bukkit.entity.Player player) Checks and updates the shown state for a player.protected abstract voidcreate()final voidprotected abstract voiddelete()final voidfinal booleanfinal @NotNull HologramDatagetData()abstract @Nullable org.bukkit.entity.DisplayReturns the Display entity of this Hologram object.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) Must be called asynchronouslyfinal voidhideHologram(org.bukkit.entity.Player player) Must be called asynchronouslyfinal booleanfinal booleanisShown(@NotNull org.bukkit.entity.Player player) protected abstract voidrefresh(@NotNull org.bukkit.entity.Player player) 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 booleanshouldHologramBeShown(@NotNull org.bukkit.entity.Player player) protected abstract booleanshow(@NotNull org.bukkit.entity.Player player) final voidshowHologram(Collection<? extends org.bukkit.entity.Player> players) Must be called asynchronouslyfinal voidshowHologram(org.bukkit.entity.Player player) Must be called asynchronouslyprotected abstract voidupdate()final void
-
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
-
shown
Set of UUIDs of players to whom the hologram is currently shown.
-
-
Konstruktordetails
-
Hologram
-
-
Methodendetails
-
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
Must be called asynchronously -
hideHologram
public final void hideHologram(org.bukkit.entity.Player player) Must be called asynchronously -
hideHologram
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
-
isShown
-
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
-
hashCode
public final int hashCode()
-