Skip to content

Commit

Permalink
[2.0.16] Fix Folia & Gradients
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsFlicker committed Mar 16, 2024
1 parent 31e78cb commit 0866b6c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ fun Component.toNative() = Components.parseRaw(gson(this))

fun ComponentText.toAdventure() = gson(toRawMessage())

fun ItemStack.toTranslatableComponentAdventure(): ComponentText {
return Component.translatable(this).toNative()
}

fun ComponentText.hoverItemAdventure(item: ItemStack): ComponentText {
return toAdventure().hoverEvent(item).toNative()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import me.arasple.mc.trchat.api.event.TrChatItemShowEvent
import me.arasple.mc.trchat.api.impl.BukkitProxyManager
import me.arasple.mc.trchat.api.nms.NMS
import me.arasple.mc.trchat.module.adventure.toNative
import me.arasple.mc.trchat.module.adventure.toTranslatableComponentAdventure
import me.arasple.mc.trchat.module.conf.file.Functions
import me.arasple.mc.trchat.module.display.function.Function
import me.arasple.mc.trchat.module.display.function.StandardFunction
Expand Down Expand Up @@ -212,7 +213,7 @@ object ItemShow : Function("ITEM") {
}
}
} else if (Folia.isFolia) {
Components.text(type.name)
toTranslatableComponentAdventure()
} else {
try {
if (MinecraftVersion.isHigherOrEqual(MinecraftVersion.V1_15)) {
Expand Down
3 changes: 1 addition & 2 deletions project/runtime-bukkit/src/main/resources/lang/en_US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ Function-Item-Show-Format-With-Hopper:
- type: json
text: '&8\[[item] &bx{0}&8\]'
args:
- hover: '&7Click to view this item'
command: '/view-item {1}'
- command: '/view-item {1}'
Function-Item-Show-Unavailable: '&c&This item has been expired or does not exist...'
Function-Item-Show-Title: '{0}''s Item'
Function-Inventory-Show-Format:
Expand Down
3 changes: 1 addition & 2 deletions project/runtime-bukkit/src/main/resources/lang/es_ES.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ Function-Item-Show-Format-With-Hopper:
- type: json
text: '&8\[[item] &bx{0}&8\]'
args:
- hover: '&7Click to view this item'
command: '/view-item {1}'
- command: '/view-item {1}'
Function-Item-Show-Unavailable: '&c&This item has been expired or does not exist...'
Function-Item-Show-Title: '{0}''s Item'
Function-Inventory-Show-Format:
Expand Down
3 changes: 1 addition & 2 deletions project/runtime-bukkit/src/main/resources/lang/zh_CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ Function-Item-Show-Format-With-Hopper:
- type: json
text: '&8\[[item] &bx{0}&8\]'
args:
- hover: '&7点击查看此物品'
command: '/view-item {1}'
- command: '/view-item {1}'
Function-Item-Show-Unavailable: '&c&l该物品已过期或不存在...'
Function-Item-Show-Title: '{0}的物品'
Function-Inventory-Show-Format:
Expand Down

0 comments on commit 0866b6c

Please sign in to comment.