better translation system

This commit is contained in:
alexcrea 2026-08-13 13:10:22 +02:00
parent c636767078
commit cb6040df10
Signed by: alexcrea
GPG key ID: E59DF23EE2A2266C
11 changed files with 257 additions and 83 deletions

View file

@ -2,7 +2,7 @@ package xyz.alexcrea.cuanvil.dependency.util
import net.kyori.adventure.text.Component
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer
import org.bukkit.inventory.ItemStack
import org.bukkit.command.CommandSender
import org.bukkit.inventory.meta.ItemMeta
// Mostly made for paper, spigot and folia support
@ -100,4 +100,19 @@ object PlatformUtil {
}
}
/**
* Try to send paper component to the player
*
* @param component The used component
* @return true if sent, else otherwise
*/
fun CommandSender.sendPaperMessage(component: Component): Boolean {
if(isPaper) {
this.sendMessage(component)
return true
}
return false
}
}