@@ -15,10 +15,8 @@ import org.bukkit.inventory.ItemStack
15
15
import org.bukkit.inventory.meta.*
16
16
import org.bukkit.potion.PotionData
17
17
import org.bukkit.potion.PotionEffect
18
- import org.tabooproject.reflex.Reflex.Companion.getProperty
19
18
import org.tabooproject.reflex.Reflex.Companion.invokeMethod
20
19
import taboolib.common.util.random
21
- import taboolib.common5.cint
22
20
import taboolib.library.xseries.XAttribute
23
21
import taboolib.library.xseries.XMaterial
24
22
import taboolib.module.chat.colored
@@ -155,6 +153,8 @@ open class ItemBuilder {
155
153
*/
156
154
var itemModel: NamespacedKey ? = null
157
155
156
+ var isHideTooltip: Boolean = false
157
+
158
158
/* *
159
159
* 唯一化
160
160
*/
@@ -294,7 +294,7 @@ open class ItemBuilder {
294
294
// CustomModelData
295
295
runCatching {
296
296
if (customModelData != - 1 ) {
297
- itemMeta.invokeMethod< Void >( " setCustomModelData" , customModelData)
297
+ itemMeta.setCustomModelData( customModelData)
298
298
}
299
299
}
300
300
// Tooltip Style
@@ -305,6 +305,10 @@ open class ItemBuilder {
305
305
runCatching {
306
306
itemMeta.itemModel = itemModel
307
307
}
308
+ // Hide Tooltip
309
+ runCatching {
310
+ itemMeta.isHideTooltip = isHideTooltip
311
+ }
308
312
// 唯一化
309
313
runCatching {
310
314
if (unique) {
@@ -401,12 +405,7 @@ open class ItemBuilder {
401
405
}
402
406
// CustomModelData
403
407
runCatching {
404
- val modelData = itemMeta.getProperty<Any >(" customModelData" )
405
- customModelData = if (modelData is Int ) {
406
- itemMeta.getProperty<Int >(" customModelData" ) ? : - 1
407
- } else {
408
- modelData?.getProperty<Any >(" handle" )?.getProperty<List <Float >>(" floats" )?.firstOrNull()?.cint ? : - 1
409
- }
408
+ customModelData = itemMeta.customModelData
410
409
}
411
410
// Tooltip Style
412
411
runCatching {
@@ -416,6 +415,10 @@ open class ItemBuilder {
416
415
runCatching {
417
416
itemModel = itemMeta.itemModel
418
417
}
418
+ // Hide Tooltip
419
+ runCatching {
420
+ isHideTooltip = itemMeta.isHideTooltip
421
+ }
419
422
}
420
423
}
421
424
0 commit comments