9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-20 07:19:23 +00:00
Files
DivineMC/patches/api/0006-Paper-PR-Add-sendTitleUpdate-for-inventories.patch
2023-04-01 00:39:15 +03:00

28 lines
1.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: nopjar <code.nopjar@gmail.com>
Date: Mon, 13 Jun 2022 11:29:42 +0200
Subject: [PATCH] Paper PR - Add sendTitleUpdate for inventories
diff --git a/src/main/java/org/bukkit/inventory/InventoryView.java b/src/main/java/org/bukkit/inventory/InventoryView.java
index daca40b63e95ea33178bcb54ad45911da591ca54..957e2d091e40ecc283343b7b07b813406d75e852 100644
--- a/src/main/java/org/bukkit/inventory/InventoryView.java
+++ b/src/main/java/org/bukkit/inventory/InventoryView.java
@@ -468,4 +468,16 @@ public abstract class InventoryView {
@Deprecated // Paper
@NotNull
public abstract String getTitle();
+
+ // Paper start
+ /**
+ * Sends a packet to the client to open a new inventory with the new title.
+ * <p>
+ * The ID of the inventory and the contents stay the same. This does not affect the title on the
+ * server. Methods like {@link #title()} will still return the old title.
+ *
+ * @param title the new title
+ */
+ public abstract void sendTitleUpdate(@NotNull net.kyori.adventure.text.Component title);
+ // Paper end
}