Skip to content
This repository was archived by the owner on Feb 16, 2022. It is now read-only.

Commit 12cf66b

Browse files
committed
doc: ドキュメントを修正
1 parent c540376 commit 12cf66b

File tree

3 files changed

+67
-9
lines changed

3 files changed

+67
-9
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ repositories {
200200
}
201201
202202
dependencies {
203-
api('com.github.sya-ri:EasySpigotAPI:2.2.2') {
203+
api('com.github.sya-ri:EasySpigotAPI:2.2.3') {
204204
exclude group: 'org.spigotmc', module: 'spigot-api'
205205
}
206206
}
@@ -214,7 +214,7 @@ repositories {
214214
}
215215

216216
dependencies {
217-
api("com.github.sya-ri:EasySpigotAPI:2.2.2") {
217+
api("com.github.sya-ri:EasySpigotAPI:2.2.3") {
218218
exclude(group = "org.spigotmc", module = "spigot-api")
219219
}
220220
}
@@ -240,7 +240,7 @@ configurations {
240240
}
241241
242242
dependencies {
243-
shadowApi('com.github.sya-ri:EasySpigotAPI:2.2.2') {
243+
shadowApi('com.github.sya-ri:EasySpigotAPI:2.2.3') {
244244
exclude group: 'org.spigotmc', module: 'spigot-api'
245245
}
246246
}
@@ -265,7 +265,7 @@ repositories {
265265
}
266266

267267
dependencies {
268-
shadowApi("com.github.sya-ri:EasySpigotAPI:2.2.2") {
268+
shadowApi("com.github.sya-ri:EasySpigotAPI:2.2.3") {
269269
exclude(group = "org.spigotmc", module = "spigot-api")
270270
}
271271
}

api/src/main/kotlin/com/github/syari/spigot/api/component/TextComponentBuilder.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class TextComponentBuilder {
2626
) = append(textComponent(text, hover, click))
2727

2828
/**
29-
* 末尾に [TextComponent] を挿入する。
29+
* 末尾に [BaseComponent] を挿入する。
3030
* @param component
3131
* @since 2.2.3
3232
*/
@@ -54,7 +54,7 @@ class TextComponentBuilder {
5454
) = append(text, hover, click).appendLine()
5555

5656
/**
57-
* 末尾に [TextComponent] を挿入し、改行する。
57+
* 末尾に [BaseComponent] を挿入し、改行する。
5858
* @param component
5959
* @since 2.2.3
6060
*/

sample/README.md

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,18 @@ class TextComponentBuilder {
4747
text: String,
4848
hover: HoverEvent? = null,
4949
click: ClickEvent? = null
50-
): TextComponent
50+
): TextComponentBuilder
51+
52+
/**
53+
* 末尾に [BaseComponent] を挿入する。
54+
* @param component
55+
*/
56+
fun append(component: BaseComponent): TextComponentBuilder
5157

5258
/**
5359
* 末尾に改行を挿入する。
5460
*/
55-
fun appendLine(): TextComponent
61+
fun appendLine(): TextComponentBuilder
5662

5763
/**
5864
* 末尾に文字列を挿入し、改行する。
@@ -64,7 +70,13 @@ class TextComponentBuilder {
6470
text: String,
6571
hover: HoverEvent? = null,
6672
click: ClickEvent? = null
67-
): TextComponent
73+
): TextComponentBuilder
74+
75+
/**
76+
* 末尾に [BaseComponent] を挿入し、改行する。
77+
* @param component
78+
*/
79+
fun appendLine(component: BaseComponent): TextComponentBuilder
6880

6981
/**
7082
* [TextComponent] に変換する。
@@ -77,6 +89,14 @@ class TextComponentBuilder {
7789
*/
7890
inline fun buildTextComponent(action: TextComponentBuilder.() -> Unit): TextComponent
7991

92+
/**
93+
* @param hover [HoverEvent] default: null
94+
* @param click [ClickEvent] default: null
95+
*/
96+
fun <T : BaseComponent> T.with(
97+
hover: HoverEvent? = null,
98+
click: ClickEvent? = null,
99+
): T
80100

81101
/**
82102
* @param text 文字列
@@ -89,6 +109,44 @@ fun textComponent(
89109
click: ClickEvent? = null,
90110
): TextComponent
91111

112+
/**
113+
* [TranslatableComponent] を生成する
114+
* @param translate 翻訳キー
115+
* @param hover [HoverEvent] default: null
116+
* @param click [ClickEvent] default: null
117+
*/
118+
fun translateComponent(
119+
translate: String,
120+
hover: HoverEvent? = null,
121+
click: ClickEvent? = null,
122+
): TranslatableComponent
123+
124+
/**
125+
* [Material] から [TranslatableComponent] を生成する
126+
* @param material 翻訳するアイテム
127+
* @param hover [HoverEvent] default: null
128+
* @param click [ClickEvent] default: null
129+
*/
130+
@UnsupportedMinecraftVersion(8, 9, 10, 11, 12)
131+
fun translateComponent(
132+
material: Material,
133+
hover: HoverEvent? = null,
134+
click: ClickEvent? = null,
135+
): TranslatableComponent
136+
137+
/**
138+
* [KeybindComponent] を生成する
139+
* @param identifier 識別子 [net.md_5.bungee.api.chat.Keybinds]
140+
* @param hover [HoverEvent] default: null
141+
* @param click [ClickEvent] default: null
142+
*/
143+
@UnsupportedMinecraftVersion(8, 9, 10, 11)
144+
fun keybindComponent(
145+
identifier: String,
146+
hover: HoverEvent? = null,
147+
click: ClickEvent? = null,
148+
): KeybindComponent
149+
92150
/**
93151
* [ClickEvent.Action.RUN_COMMAND] の [ClickEvent]
94152
*/

0 commit comments

Comments
 (0)