Skip to content

Commit

Permalink
[2.0.4] ItemShow更改为箱子界面
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsFlicker committed Mar 3, 2024
1 parent 5ce5469 commit 15be651
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import taboolib.module.nms.MinecraftVersion
import taboolib.module.nms.getI18nName
import taboolib.module.nms.getInternalName
import taboolib.module.ui.buildMenu
import taboolib.module.ui.type.Hopper
import taboolib.module.ui.type.Basic
import taboolib.platform.util.asLangText
import taboolib.platform.util.buildItem
import taboolib.platform.util.sendLang
Expand Down Expand Up @@ -151,10 +151,14 @@ object ItemShow : Function("ITEM") {
if (cacheHopper.getIfPresent(sha1) != null) {
return sha1 to cacheHopper.getIfPresent(sha1)!!.serializeToByteArray().encodeBase64()
}
val menu = buildMenu<Hopper>(sender.asLangText("Function-Item-Show-Title", sender.name)) {
rows(1)
map("xxixx")
set('x', XMaterial.BLACK_STAINED_GLASS_PANE) { name = "§r" }
val menu = buildMenu<Basic>(sender.asLangText("Function-Item-Show-Title", sender.name)) {
rows(3)
map(
"xxxxxxxxx",
"xxxxixxxx",
"xxxxxxxxx"
)
set('x', XMaterial.BLACK_STAINED_GLASS_PANE) { name = "§f" }
set('i', item)
onClick(lock = true)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ sealed interface BukkitProxyProcessor : PluginMessageListener {
val name = data[2]
val sha1 = data[3]
if (ItemShow.cacheHopper.getIfPresent(sha1) == null) {
val inventory = data[4].decodeBase64().deserializeToInventory(createNoClickHopper(console().asLangText("Function-Item-Show-Title", name)))
val inventory = data[4].decodeBase64().deserializeToInventory(
createNoClickChest(3, console().asLangText("Function-Item-Show-Title", name))
)
ItemShow.cacheHopper.put(sha1, inventory)
}
}
Expand All @@ -128,7 +130,9 @@ sealed interface BukkitProxyProcessor : PluginMessageListener {
val name = data[2]
val sha1 = data[3]
if (InventoryShow.cache.getIfPresent(sha1) == null) {
val inventory = data[4].decodeBase64().deserializeToInventory(createNoClickChest(6, console().asLangText("Function-Inventory-Show-Title", name)))
val inventory = data[4].decodeBase64().deserializeToInventory(
createNoClickChest(6, console().asLangText("Function-Inventory-Show-Title", name))
)
InventoryShow.cache.put(sha1, inventory)
}
}
Expand All @@ -138,7 +142,9 @@ sealed interface BukkitProxyProcessor : PluginMessageListener {
val name = data[2]
val sha1 = data[3]
if (EnderChestShow.cache.getIfPresent(sha1) == null) {
val inventory = data[4].decodeBase64().deserializeToInventory(createNoClickChest(3, console().asLangText("Function-EnderChest-Show-Title", name)))
val inventory = data[4].decodeBase64().deserializeToInventory(
createNoClickChest(3, console().asLangText("Function-EnderChest-Show-Title", name))
)
EnderChestShow.cache.put(sha1, inventory)
}
}
Expand Down

0 comments on commit 15be651

Please sign in to comment.