[Paper1.21.4]Sunlight计分板-基于ProtocolLib和PlaceholderAPI – Golden Territory
[Paper1.21.4]Sunlight计分板-基于ProtocolLib和PlaceholderAPI

首先Sunlight内置并默认开启了scoreboard模块,在plugins/Sunlight/modules/scoreboard/就可以找到。

尽管如此,Sunlight的计分板并不会在默认状态下生效,这是因为缺少了依赖的插件。

ProtocolLib允许Sunlight显示计分板。

PlaceholderAPI允许Sunlight使用占位符读取特定数据。

有关PAPI的中文Wiki-来自Continue Project


只安装ProtocolLib,无需任何配置就可以使计分板显示在玩家的客户端,但是你会发现计分板上是这样的“乱码”。当然你很容易就能看出来这些乱码的含义,它们都是占位符。

使用/scoreboard 可以开关计分板显示,你需要在Luckperms中给玩家开启sunlight.scoreboard权限。

我们需要一个插件来解析占位符,将其变成我们希望显示的数据/信息,这个插件就是PlaceholderAPI,简称PAPI。


即使你安装了PAPI,登陆游戏会发现计分板还是只能显示占位符。这是因为PAPI的占位符采用拓展机制,你必须安装对应的拓展才能正确解析占位符。使用

/papi list 

来查看当前拓展列表。

你会发现尽管你什么拓展都没安装,但是依然有一个placeholder hook,即sunlight。这是因为Sunlight插件内置了对PAPI的支持,详见官方文档

但对某些插件,如Luckperms而言,你依然需要单独安装拓展才能解析对应的占位符。使用

/papi ecloud download [name]

来下载对应的拓展,建议在游戏内使用自动补全,便于确认有哪些可安装的拓展,你也可以在Continue Project翻译过的文档中查看拓展。当你需要查看有哪些占位符可用时,也可以在这个文档中查询。


这篇文章写到这里就搁置了很久。我决定先将其发布出来。

剩下的步骤就是编辑计分板了。计分板配置文件在plugins/SunLight/modules/scoreboard下,有annimations.yml和settings.yml两个文件。

计分板的每一行的滚动时间都可以单独设置,当然代价是编辑起来有点麻烦。

以下是香草服使用的计分板配置,Sunlight版本3.12.6。

link:
  Update_Interval_MS: 1000
  Texts:
  - <orange> ▎</orange><white> ▎▎</white><gray>▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎    ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎</gray>
  - <orange> ▎</orange><white> ▎▎▎▎</white><gray>▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎    ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎</gray>
  - <orange> ▎</orange><white> ▎▎▎▎▎▎</white><gray>▎▎▎▎▎▎▎▎▎▎▎▎▎▎    ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎</gray>
  - <orange> ▎</orange><white> ▎▎▎▎▎▎▎▎</white><gray>▎▎▎▎▎▎▎▎▎▎▎▎    ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎</gray>
  - <orange> ▎</orange><white> ▎▎▎▎▎▎▎▎▎▎</white><gray>▎▎▎▎▎▎▎▎▎▎    ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎</gray>
  - <orange> ▎</orange><white> ▎▎▎▎▎▎▎▎▎▎▎▎</white><gray>▎▎▎▎▎▎▎▎    ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎</gray>
  - <orange> ▎</orange><white> ▎▎▎▎▎▎▎▎▎▎▎▎▎▎</white><gray>▎▎▎▎▎▎    ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎</gray>
  - <orange> ▎</orange><white> ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎</white><gray>▎▎▎▎    ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎</gray>
  - <orange> ▎</orange><white> ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎</white><gray>▎▎    ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎</gray>
  - <orange> ▎</orange><white> ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎</white><gray>    ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎</gray>
  - <orange> ▎</orange><white> ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎    ▎▎</white><gray>▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎</gray>
  - <orange> ▎</orange><white> ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎    ▎▎▎▎</white><gray>▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎</gray>
  - <orange> ▎</orange><white> ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎    ▎▎▎▎▎▎</white><gray>▎▎▎▎▎▎▎▎▎▎▎▎▎▎</gray>
  - <orange> ▎</orange><white> ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎    ▎▎▎▎▎▎▎▎</white><gray>▎▎▎▎▎▎▎▎▎▎▎▎</gray>
  - <orange> ▎</orange><white> ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎    ▎▎▎▎▎▎▎▎▎▎</white><gray>▎▎▎▎▎▎▎▎▎▎</gray>
  - <orange> ▎</orange><white> ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎    ▎▎▎▎▎▎▎▎▎▎▎▎</white><gray>▎▎▎▎▎▎▎▎</gray>
  - <orange> ▎</orange><white> ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎    ▎▎▎▎▎▎▎▎▎▎▎▎▎▎</white><gray>▎▎▎▎▎▎</gray>
  - <orange> ▎</orange><white> ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎    ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎</white><gray>▎▎▎▎</gray>
  - <orange> ▎</orange><white> ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎    ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎</white><gray>▎▎</gray>
  - <orange> ▎</orange><white> ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎    ▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎</white><gray></gray>

  
l0:
  Update_Interval_MS: 10000
  Texts:
    - <blue>%player_displayname%</blue>
    - <blue>%player_displayname%</blue>
    - <green>缺德地图</green>
    - <red>%server_name%</red>
l2:
  Update_Interval_MS: 10000
  Texts:
    - <blue> ▎ <gray>当前等级:</gray> <white>%player_level%</white></blue>
    - <blue> ▎ <gray>当前等级:</gray> <white>%player_level%</white></blue>
    - <green> ▎ <gray>当前世界:</gray> <white>%player_world%</white></green>    
    - <red> ▎ <gray>游戏版本:</gray><white>%server_version%</white></red>
l3:
  Update_Interval_MS: 10000
  Texts:
    - <blue> ▎ <gray>总计经验:</gray> <white>%player_current_exp% / %player_total_exp%</white></blue>
    - <blue> ▎ <gray>总计经验:</gray> <white>%player_current_exp% / %player_total_exp%</white></blue>
    - <green> ▎ <gray>生态群系:</gray> <white>%player_biome_capitalized%</white></green>
    - <red> ▎ <gray>在线人数:</gray><white>%server_online% / %server_max_players%</white></red>
l4:
  Update_Interval_MS: 10000
  Texts:
    - <blue> ▎ <gray>升级经验:</gray> <white>%player_exp_to_level%</white></blue>
    - <blue> ▎ <gray>升级经验:</gray> <white>%player_exp_to_level%</white></blue>
    - <green> ▎ <gray>当前亮度:</gray> <white>%player_light_level%</white></green>
    - <red> ▎ <gray>运行时间:</gray><white>%server_uptime%</white></red>
l5:
  Update_Interval_MS: 10000
  Texts:
    - <blue> ▎ <gray>玩家击败:</gray> <white>%statistic_player_kills%</white></blue>
    - <blue> ▎ <gray>玩家击败:</gray> <white>%statistic_player_kills%</white></blue>
    - <green> ▎ <gray>世界时间:</gray> <white>%player_world_time_24%</white></green>
    - <red> ▎ <gray>TPS:</gray><white>%server_tps%</white></red>
l6:
  Update_Interval_MS: 10000
  Texts:
    - <blue> ▎ <gray>暴死次数:</gray> <white>%statistic_deaths%</white></blue>
    - <blue> ▎ <gray>暴死次数:</gray> <white>%statistic_deaths%</white></blue>
    - <green> ▎ <gray>当前坐标:</gray> <white>%player_x%<gray> , </gray>%player_z%</white></green>
    - <red> ▎ <gray>区块数量:</gray><white>%server_total_chunks%</white></red>
l7:
  Update_Interval_MS: 10000
  Texts:
    - <blue> ▎ <gray>权限节点:</gray> <white>%luckperms_groups%</white></blue>
    - <blue> ▎ <gray>权限节点:</gray> <white>%luckperms_groups%</white></blue>
    - <green> ▎ <gray>当前高度:</gray> <white>%player_y%</white></green>
    - <red> ▎ <gray>内存占用:</gray><white>%server_ram_used%</white></red>
l8:
  Update_Interval_MS: 10000
  Texts:
    - <blue> ▎ <gray>Diorite :</gray> <white>%statistic_mine_block:diorite%</white></blue>
    - <blue> ▎ <gray>Diorite :</gray> <white>%statistic_mine_block:diorite%</white></blue>
    - ' '
    - ' '
l9:
  Update_Interval_MS: 10000
  Texts:
    - <blue> ▎ <gray>游戏时间:</gray> <white>%statistic_time_played%</white></blue>
    - <blue> ▎ <gray>游戏时间:</gray> <white>%statistic_time_played%</white></blue>
    - ' '
    - ' '
l10:
  Update_Interval_MS: 10000
  Texts:
    - <blue> ▎ <gray>钓鱼次数:</gray> <white>%statistic_fish_caught%</white></blue>
    - <blue> ▎ <gray>钓鱼次数:</gray> <white>%statistic_fish_caught%</white></blue>
    - ' '
    - ' '
l11:
  Update_Interval_MS: 10000
  Texts:
    - <blue> ▎ <gray>挖掘次数:</gray> <white>%ptl_player_count_挖掘总榜(个)%</white></blue>
    - <blue> ▎ <gray>挖掘次数:</gray> <white>%ptl_player_count_挖掘总榜(个)%</white></blue>
    - ' '
    - ' '
# Individual per-player scoreboard format based on player's rank and world.
# [You must have Vault with compatible Permissions plugins installed for this feature to work properly]
#
# If multiple scoreboards are available for a player, the one with the greatest priority will be used.
# If no scoreboard is available for a player, the one labeled 'default' will be used (if present).
#
# Add '*' to the 'Groups' list to make scoreboard available for any rank.
# Add '*' to the 'Worlds' list to make scoreboard available in any world.
#
# Use '%animation:[name]%' placeholder to include dynamic text (animation) from the animations.yml config file.
# Text and Color Formations: https://github.com/nulli0n/nightcore-spigot/wiki/Text-Formation
# You can use PlaceholderAPI placeholders.
Boards:
  default:
    Update_Interval: 10
    Priority: 1
    Worlds:
    - '*'
    Groups:
    - '*'
    Title: <gradient:#84CCFB:#C9E5FD><b>香草服</b></gradient>
    Lines:
    - <gray>%server_time_yyyy/MM/dd/HH:mm:ss%</gray>
    - <gray>Ping:</gray><white>%player_ping%</white>
    - ' '
    - '%animation:l0%'
    - '%animation:l2%'
    - '%animation:l3%'
    - '%animation:l4%'
    - '%animation:l5%'
    - '%animation:l6%'
    - '%animation:l7%'
    - '%animation:l8%'
    - '%animation:l9%'
    - '%animation:l10%'
    - '%animation:l11%'
    - '%animation:link%'
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇