From 101494af90478811767f5c2fa652571c64e72270 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Thu, 4 May 2023 18:52:15 +1000 Subject: [PATCH] #849: Add InventoryView#setTitle By: Y2Kwastaken --- .../org/bukkit/inventory/InventoryView.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/inventory/InventoryView.java b/paper-api/src/main/java/org/bukkit/inventory/InventoryView.java index 5fc95b83db..e12996492c 100644 --- a/paper-api/src/main/java/org/bukkit/inventory/InventoryView.java +++ b/paper-api/src/main/java/org/bukkit/inventory/InventoryView.java @@ -454,4 +454,25 @@ public abstract class InventoryView { */ @NotNull public abstract String getTitle(); + + /** + * Get the original title of this inventory window, before any changes were + * made using {@link #setTitle(String)}. + * + * @return the original title + */ + @NotNull + public abstract String getOriginalTitle(); + + /** + * Sets the title of this inventory window to the specified title if the + * inventory window supports it. + *

+ * Note if the inventory does not support titles that can be changed (ie, it + * is not creatable or viewed by a player), then this method will throw an + * exception. + * + * @param title The new title. + */ + public abstract void setTitle(@NotNull String title); }