mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-08-28 08:25:56 +02:00
better translation system
This commit is contained in:
parent
da49e79dbf
commit
e6ebdcdfc0
11 changed files with 257 additions and 83 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue