Skip to content

Commit 3a74e65

Browse files
CopilotTrilleo
andauthored
Internal: Update UI title documentation from String to Component
Agent-Logs-Url: https://github.com/Trilleo/PaperExamplePlugin/sessions/8b5d43e4-0935-4770-a071-89aac05e1809 Co-authored-by: Trilleo <133519132+Trilleo@users.noreply.github.com>
1 parent 10cfb96 commit 3a74e65

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

docs/DEVELOPER_GUIDE.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ or a subpackage.
266266
| Property | Type | Default | Description |
267267
|:---------|:---------|:-------------|:-----------------------------------------|
268268
| `id` | `String` | *(required)* | Unique identifier used to open the GUI |
269-
| `title` | `String` | *(required)* | Title displayed at the top of the chest |
269+
| `title` | `Component` | *(required)* | Title displayed at the top of the chest |
270270
| `rows` | `Int` | `3` | Number of rows (1–6, each row = 9 slots) |
271271

272272
### Methods to Override
@@ -294,6 +294,7 @@ GUIManager.open(player, "settings")
294294
package com.example.exampleplugin.guis
295295

296296
import com.example.exampleplugin.registration.PluginGUI
297+
import net.kyori.adventure.text.Component
297298
import org.bukkit.Material
298299
import org.bukkit.entity.Player
299300
import org.bukkit.event.inventory.InventoryClickEvent
@@ -302,13 +303,13 @@ import org.bukkit.inventory.ItemStack
302303

303304
class SettingsGUI : PluginGUI(
304305
id = "settings",
305-
title = "Settings",
306+
title = Component.text("Settings"),
306307
rows = 3
307308
) {
308309
override fun setup(player: Player, inventory: Inventory) {
309310
val compass = ItemStack(Material.COMPASS)
310311
val meta = compass.itemMeta
311-
meta.displayName(net.kyori.adventure.text.Component.text("Tracker"))
312+
meta.displayName(Component.text("Tracker"))
312313
compass.itemMeta = meta
313314
inventory.setItem(13, compass)
314315
}

src/main/kotlin/com/example/exampleplugin/registration/PluginGUI.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import org.bukkit.inventory.Inventory
2727
*
2828
* class SettingsGUI : PluginGUI(
2929
* id = "settings",
30-
* title = "Settings",
30+
* title = Component.text("Settings"),
3131
* rows = 3
3232
* ) {
3333
* override fun setup(player: Player, inventory: Inventory) {

0 commit comments

Comments
 (0)