Class AdvancementDisplay
- Direct Known Subclasses:
FakeAdvancement.FakeAdvancementDisplay
,FancyAdvancementDisplay
AdvancementDisplay
class contains the graphical information of the advancement.
It contains the title, description, icon, etc. etc.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected final boolean
Whether the advancement completion message should be sent on advancement grant.protected final BaseComponent[]
The fancy description used byAdvancement.getAnnounceMessage(Player)
.protected final BaseComponent[]
The fancy title used byAdvancement.getAnnounceMessage(Player)
.protected final String
The description of the advancement compacted as a singleString
(with'\n' + defaultColorCode
between lines).protected final @Unmodifiable List
<String> The description of the advancement.protected final AdvancementFrameType
The shape of the advancement frame in the advancement GUI.protected final ItemStack
The icon of the advancement in the advancement GUI.protected final String
The trimmed title of the advancement.protected final boolean
Whether the toast notification should be sent on advancement grant.protected final String
The title of the advancement.protected final float
The advancement x coordinate.protected final float
The advancement y coordinate. -
Constructor Summary
ConstructorDescriptionAdvancementDisplay
(@NotNull Material icon, @NotNull String title, @NotNull AdvancementFrameType frame, boolean showToast, boolean announceChat, float x, float y, @NotNull String... description) Creates a newAdvancementDisplay
.AdvancementDisplay
(@NotNull Material icon, @NotNull String title, @NotNull AdvancementFrameType frame, boolean showToast, boolean announceChat, float x, float y, @NotNull List<String> description) Creates a newAdvancementDisplay
.AdvancementDisplay
(@NotNull ItemStack icon, @NotNull String title, @NotNull AdvancementFrameType frame, boolean showToast, boolean announceChat, float x, float y, @NotNull String... description) Creates a newAdvancementDisplay
.AdvancementDisplay
(@NotNull ItemStack icon, @NotNull String title, @NotNull AdvancementFrameType frame, boolean showToast, boolean announceChat, float x, float y, @NotNull List<String> description) Creates a newAdvancementDisplay
.AdvancementDisplay
(@NotNull ItemStack icon, @NotNull String title, @NotNull AdvancementFrameType frame, boolean showToast, boolean announceChat, float x, float y, @NotNull ChatColor defaultColor, @NotNull String... description) Creates a newAdvancementDisplay
.AdvancementDisplay
(@NotNull ItemStack icon, @NotNull String title, @NotNull AdvancementFrameType frame, boolean showToast, boolean announceChat, float x, float y, @NotNull ChatColor defaultColor, @NotNull List<String> description) Creates a newAdvancementDisplay
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether the advancement completion message should be sent on advancement grant.boolean
Returns whether the toast notification should be sent on advancement grant.Gets theBaseComponent
array that contains the fancy description.Gets theBaseComponent
array that contains the fancy title.Returns the compacted description.Returns the description of the advancement.getFrame()
Returns the shape of the advancement frame in the advancement GUI.getIcon()
Gets a clone of the icon.getNMSWrapper
(@NotNull Advancement advancement) Returns theAdvancementDisplay
NMS wrapper, using the provided advancement for construction (when necessary).Returns the trimmed title of the advancement.getTitle()
Returns the title of the advancement.float
getX()
Returns the advancement position relative to the x-axis.float
getY()
Returns the advancement position relative to the y-axis.
-
Field Details
-
icon
The icon of the advancement in the advancement GUI. -
chatTitle
The fancy title used byAdvancement.getAnnounceMessage(Player)
. -
chatDescription
The fancy description used byAdvancement.getAnnounceMessage(Player)
. -
title
The title of the advancement. -
rawTitle
The trimmed title of the advancement. -
description
The description of the advancement. -
compactDescription
The description of the advancement compacted as a singleString
(with'\n' + defaultColorCode
between lines). -
frame
The shape of the advancement frame in the advancement GUI. -
showToast
protected final boolean showToastWhether the toast notification should be sent on advancement grant. -
announceChat
protected final boolean announceChatWhether the advancement completion message should be sent on advancement grant. -
x
protected final float xThe advancement x coordinate. -
y
protected final float yThe advancement y coordinate.
-
-
Constructor Details
-
AdvancementDisplay
public AdvancementDisplay(@NotNull @NotNull Material icon, @NotNull @NotNull String title, @NotNull @NotNull AdvancementFrameType frame, boolean showToast, boolean announceChat, float x, float y, @NotNull @NotNull String... description) Creates a newAdvancementDisplay
.The default color of the title and description is
frame.getColor()
.The advancement is positioned by the x and y coordinates in the advancement GUI. The origin is placed in the upper-left corner of the advancement GUI. The x-axis points to the right (as usual), whereas the y-axis points downward. Thus, the x and y coordinates must be positive.
- Parameters:
icon
- The material of the advancement's icon in the advancement GUI.title
- The title of the advancement.frame
- The shape of the advancement frame in the advancement GUI.showToast
- Whether the toast notification should be sent on advancement grant.announceChat
- Whether the advancement completion message should be sent on advancement grant.x
- The advancement x coordinate. Must be not negative.y
- The advancement y coordinate. Must be not negative.description
- The description of the advancement.
-
AdvancementDisplay
public AdvancementDisplay(@NotNull @NotNull Material icon, @NotNull @NotNull String title, @NotNull @NotNull AdvancementFrameType frame, boolean showToast, boolean announceChat, float x, float y, @NotNull @NotNull List<String> description) Creates a newAdvancementDisplay
.The default color of the title and description is
frame.getColor()
.The advancement is positioned by the x and y coordinates in the advancement GUI. The origin is placed in the upper-left corner of the advancement GUI. The x-axis points to the right (as usual), whereas the y-axis points downward. Thus, the x and y coordinates must be positive.
- Parameters:
icon
- The material of the advancement's icon in the advancement GUI.title
- The title of the advancement.frame
- The shape of the advancement frame in the advancement GUI.showToast
- Whether the toast notification should be sent on advancement grant.announceChat
- Whether the advancement completion message should be sent on advancement grant.x
- The advancement x coordinate. Must be not negative.y
- The advancement y coordinate. Must be not negative.description
- The description of the advancement.
-
AdvancementDisplay
public AdvancementDisplay(@NotNull @NotNull ItemStack icon, @NotNull @NotNull String title, @NotNull @NotNull AdvancementFrameType frame, boolean showToast, boolean announceChat, float x, float y, @NotNull @NotNull String... description) Creates a newAdvancementDisplay
.The default color of the title and description is
frame.getColor()
.The advancement is positioned by the x and y coordinates in the advancement GUI. The origin is placed in the upper-left corner of the advancement GUI. The x-axis points to the right (as usual), whereas the y-axis points downward. Thus, the x and y coordinates must be positive.
- Parameters:
icon
- The advancement's icon in the advancement GUI.title
- The title of the advancement.frame
- The shape of the advancement frame in the advancement GUI.showToast
- Whether the toast notification should be sent on advancement grant.announceChat
- Whether the advancement completion message should be sent on advancement grant.x
- The advancement x coordinate. Must be not negative.y
- The advancement y coordinate. Must be not negative.description
- The description of the advancement.
-
AdvancementDisplay
public AdvancementDisplay(@NotNull @NotNull ItemStack icon, @NotNull @NotNull String title, @NotNull @NotNull AdvancementFrameType frame, boolean showToast, boolean announceChat, float x, float y, @NotNull @NotNull List<String> description) Creates a newAdvancementDisplay
.The default color of the title and description is
frame.getColor()
.The advancement is positioned by the x and y coordinates in the advancement GUI. The origin is placed in the upper-left corner of the advancement GUI. The x-axis points to the right (as usual), whereas the y-axis points downward. Thus, the x and y coordinates must be positive.
- Parameters:
icon
- The advancement's icon in the advancement GUI.title
- The title of the advancement.frame
- The shape of the advancement frame in the advancement GUI.showToast
- Whether the toast notification should be sent on advancement grant.announceChat
- Whether the advancement completion message should be sent on advancement grant.x
- The advancement x coordinate. Must be not negative.y
- The advancement y coordinate. Must be not negative.description
- The description of the advancement.
-
AdvancementDisplay
public AdvancementDisplay(@NotNull @NotNull ItemStack icon, @NotNull @NotNull String title, @NotNull @NotNull AdvancementFrameType frame, boolean showToast, boolean announceChat, float x, float y, @NotNull @NotNull ChatColor defaultColor, @NotNull @NotNull String... description) Creates a newAdvancementDisplay
.The advancement is positioned by the x and y coordinates in the advancement GUI. The origin is placed in the upper-left corner of the advancement GUI. The x-axis points to the right (as usual), whereas the y-axis points downward. Thus, the x and y coordinates must be positive.
- Parameters:
icon
- The advancement's icon in the advancement GUI.title
- The title of the advancement.frame
- The shape of the advancement frame in the advancement GUI.showToast
- Whether the toast notification should be sent on advancement grant.announceChat
- Whether the advancement completion message should be sent on advancement grant.x
- The advancement x coordinate. Must be not negative.y
- The advancement y coordinate. Must be not negative.defaultColor
- The default color of the title and description.description
- The description of the advancement.
-
AdvancementDisplay
public AdvancementDisplay(@NotNull @NotNull ItemStack icon, @NotNull @NotNull String title, @NotNull @NotNull AdvancementFrameType frame, boolean showToast, boolean announceChat, float x, float y, @NotNull @NotNull ChatColor defaultColor, @NotNull @NotNull List<String> description) Creates a newAdvancementDisplay
.The advancement is positioned by the x and y coordinates in the advancement GUI. The origin is placed in the upper-left corner of the advancement GUI. The x-axis points to the right (as usual), whereas the y-axis points downward. Thus, the x and y coordinates must be positive.
- Parameters:
icon
- The advancement's icon in the advancement GUI.title
- The title of the advancement.frame
- The shape of the advancement frame in the advancement GUI.showToast
- Whether the toast notification should be sent on advancement grant.announceChat
- Whether the advancement completion message should be sent on advancement grant.x
- The advancement x coordinate. Must be not negative.y
- The advancement y coordinate. Must be not negative.defaultColor
- The default color of the title and description.description
- The description of the advancement.
-
-
Method Details
-
doesShowToast
public boolean doesShowToast()Returns whether the toast notification should be sent on advancement grant.- Returns:
- Whether the toast notification should be sent on advancement grant.
-
doesAnnounceToChat
public boolean doesAnnounceToChat()Returns whether the advancement completion message should be sent on advancement grant.- Returns:
- Whether the advancement completion message should be sent on advancement grant.
-
getChatTitle
Gets theBaseComponent
array that contains the fancy title. Used byAdvancement.getAnnounceMessage(Player)
.- Returns:
- The
BaseComponent
array that contains the fancy title.
-
getChatDescription
Gets theBaseComponent
array that contains the fancy description. Used byAdvancement.getAnnounceMessage(Player)
.- Returns:
- The
BaseComponent
array that contains the fancy description.
-
getIcon
Gets a clone of the icon.- Returns:
- A clone of the icon.
-
getNMSWrapper
@NotNull public @NotNull AdvancementDisplayWrapper getNMSWrapper(@NotNull @NotNull Advancement advancement) Returns theAdvancementDisplay
NMS wrapper, using the provided advancement for construction (when necessary).- Parameters:
advancement
- The advancement used, when necessary, to create the NMS wrapper. Must be notnull
.- Returns:
- The
AdvancementDisplay
NMS wrapper.
-
getTitle
Returns the title of the advancement.- Returns:
- The title of the advancement.
-
getRawTitle
Returns the trimmed title of the advancement.- Returns:
- The trimmed title of the advancement.
-
getDescription
Returns the description of the advancement.- Returns:
- The description of the advancement.
-
getCompactDescription
Returns the compacted description.- Returns:
- The compacted description.
- See Also:
-
getFrame
Returns the shape of the advancement frame in the advancement GUI.- Returns:
- The shape of the advancement frame in the advancement GUI.
-
getX
public float getX()Returns the advancement position relative to the x-axis.- Returns:
- The x coordinate.
-
getY
public float getY()Returns the advancement position relative to the y-axis.- Returns:
- The y coordinate.
-