From e206e8f61c98246a178d640c5292988b91f13275 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sun, 14 Sep 2025 10:17:46 +0200 Subject: [PATCH] fancyholograms-v3: Add javadocs to TextHologramBuilder --- .../api/data/builder/TextHologramBuilder.java | 47 ++++++++++++++++++- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/plugins/fancyholograms/fh-api/src/main/java/com/fancyinnovations/fancyholograms/api/data/builder/TextHologramBuilder.java b/plugins/fancyholograms/fh-api/src/main/java/com/fancyinnovations/fancyholograms/api/data/builder/TextHologramBuilder.java index fed782f8..a37b4442 100644 --- a/plugins/fancyholograms/fh-api/src/main/java/com/fancyinnovations/fancyholograms/api/data/builder/TextHologramBuilder.java +++ b/plugins/fancyholograms/fh-api/src/main/java/com/fancyinnovations/fancyholograms/api/data/builder/TextHologramBuilder.java @@ -19,25 +19,47 @@ public class TextHologramBuilder extends HologramBuilder { * * @param name the name of the text hologram * @param location the location of the text hologram - * @return a new instance of TextHologramBuilder */ public static TextHologramBuilder create(String name, Location location) { return new TextHologramBuilder(name, location); } + /** + * Sets the text lines for the text hologram. + * Each string in the list represents a separate line of text. + * + * @param text the list of text lines + */ public TextHologramBuilder text(List text) { ((TextHologramData) data).setText(text); return this; } + /** + * Sets the text lines for the text hologram using a single string. + * The string will be treated as a single line of text. + * + * @param text the text line + */ public TextHologramBuilder text(String text) { return text(List.of(text)); } + /** + * Sets the text lines for the text hologram using an array of strings. + * Each string in the array represents a separate line of text. + * + * @param text the array of text lines + */ public TextHologramBuilder text(String... text) { return text(List.of(text)); } + /** + * Sets the background color of the text hologram. + * + * @param background the background color + */ public TextHologramBuilder background(Color background) { ((TextHologramData) data).setBackground(background); return this; @@ -47,28 +69,49 @@ public class TextHologramBuilder extends HologramBuilder { * Sets the background color of the text hologram using a color code in ARGB format. * * @param background the ARGB color code as a string (#AARRGGBB) - * @return the updated instance of TextHologramBuilder for method chaining */ public TextHologramBuilder background(String background) { int argb = Integer.parseInt(background.substring(1), 16); return background(Color.fromARGB(argb)); } + /** + * Sets the text alignment of the text hologram. + * + * @param textAlignment the text alignment (e.g., LEFT, CENTER, RIGHT) + */ public TextHologramBuilder textAlignment(TextDisplay.TextAlignment textAlignment) { ((TextHologramData) data).setTextAlignment(textAlignment); return this; } + /** + * Sets whether the text hologram should have a shadow effect. + * In newer versions, you can also use the shadow by MiniMessage, which also supports shadow colors. + * + * @param textShadow true to enable text shadow, false to disable + */ public TextHologramBuilder textShadow(boolean textShadow) { ((TextHologramData) data).setTextShadow(textShadow); return this; } + /** + * Sets whether the text hologram should be see-through. + * + * @param seeThrough true to enable see-through, false to disable + */ public TextHologramBuilder seeThrough(boolean seeThrough) { ((TextHologramData) data).setSeeThrough(seeThrough); return this; } + /** + * Sets the interval (in ticks) at which the text of the hologram should be updated. + * This is useful for dynamic text / placeholders that changes over time. + * + * @param updateTextInterval the update interval in ticks + */ public TextHologramBuilder updateTextInterval(int updateTextInterval) { ((TextHologramData) data).setTextUpdateInterval(updateTextInterval); return this;