Files
Paper/paper-api/src/main/java/org/bukkit/entity/TextDisplay.java
T
+1 f00727c57e 1.21.5
Co-authored-by: Bjarne Koll <git@lynxplay.dev>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Co-authored-by: MiniDigger | Martin <admin@minidigger.dev>
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Co-authored-by: Shane Freeder <theboyetronic@gmail.com>
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com>
Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
2025-04-12 17:27:00 +02:00

164 lines
3.2 KiB
Java

package org.bukkit.entity;
import org.bukkit.Color;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Represents a text display entity.
*/
public interface TextDisplay extends Display {
/**
* Gets the displayed text.
*
* @return the displayed text.
* @deprecated in favour of {@link #text()}
*/
@Nullable
@Deprecated // Paper
String getText();
/**
* Sets the displayed text.
*
* @param text the new text
* @deprecated in favour of {@link #text(net.kyori.adventure.text.Component)}
*/
@Deprecated // Paper
void setText(@Nullable String text);
/**
* Gets the displayed text.
*
* @return the displayed text
*/
net.kyori.adventure.text.@NotNull Component text();
/**
* Sets the displayed text.
*
* @param text the new text
*/
void text(net.kyori.adventure.text.@Nullable Component text);
/**
* Gets the maximum line width before wrapping.
*
* @return the line width
*/
int getLineWidth();
/**
* Sets the maximum line width before wrapping.
*
* @param width new line width
*/
void setLineWidth(int width);
/**
* Gets the text background color.
*
* @return the background color
*/
@Nullable
Color getBackgroundColor();
/**
* Sets the text background color.
*
* @param color new background color
*/
void setBackgroundColor(@Nullable Color color);
/**
* Gets the text opacity.
*
* @return opacity or -1 if not set
*/
byte getTextOpacity();
/**
* Sets the text opacity.
*
* @param opacity new opacity or -1 if default
*/
void setTextOpacity(byte opacity);
/**
* Gets if the text is shadowed.
*
* @return shadow status
*/
boolean isShadowed();
/**
* Sets if the text is shadowed.
*
* @param shadow if shadowed
*/
void setShadowed(boolean shadow);
/**
* Gets if the text is see through.
*
* @return see through status
*/
boolean isSeeThrough();
/**
* Sets if the text is see through.
*
* @param seeThrough if see through
*/
void setSeeThrough(boolean seeThrough);
/**
* Gets if the text has its default background.
*
* @return default background
*/
boolean isDefaultBackground();
/**
* Sets if the text has its default background.
*
* @param defaultBackground if default
*/
void setDefaultBackground(boolean defaultBackground);
/**
* Gets the text alignment for this display.
*
* @return text alignment
*/
@NotNull
TextAlignment getAlignment();
/**
* Sets the text alignment for this display.
*
* @param alignment new alignment
*/
void setAlignment(@NotNull TextAlignment alignment);
/**
* Represents possible text alignments for this display.
*/
public enum TextAlignment {
/**
* Center aligned text (default).
*/
CENTER,
/**
* Left aligned text.
*/
LEFT,
/**
* Right aligned text.
*/
RIGHT;
}
}