mirror of
https://e.coding.net/circlecloud/MiaoBoard.git
synced 2024-11-22 01:49:05 +00:00
feat: 添加插件版本变量
Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
parent
1d88cd4233
commit
c87cc77d3a
@ -7,6 +7,7 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import cn.citycraft.PluginHelper.kit.StrKit;
|
||||
import cn.citycraft.PluginHelper.pluginapi.PluginAPI;
|
||||
import pw.yumc.YumCore.bukkit.P;
|
||||
import pw.yumc.YumCore.bukkit.compatible.C;
|
||||
|
||||
public class Replace {
|
||||
@ -38,13 +39,16 @@ public class Replace {
|
||||
case "server":
|
||||
text = server(player, ka[1]);
|
||||
break;
|
||||
case "plugin":
|
||||
text = plugin(player, ka[1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
public static String player(final Player player, final String key) {
|
||||
private static String player(final Player player, final String key) {
|
||||
switch (key) {
|
||||
case "x":
|
||||
return String.valueOf(player.getLocation().getBlockX());
|
||||
@ -67,6 +71,15 @@ public class Replace {
|
||||
}
|
||||
}
|
||||
|
||||
private static String plugin(final Player player, final String key) {
|
||||
switch (key) {
|
||||
case "version":
|
||||
return P.getDescription().getVersion();
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
private static String server(final Player player, final String key) {
|
||||
final Runtime runtime = Runtime.getRuntime();
|
||||
switch (key) {
|
||||
|
@ -13,6 +13,8 @@ Boards:
|
||||
title: '记分板简介'
|
||||
permission: mb.default
|
||||
lines:
|
||||
- '&6插件版本: &b%plugin_version%'
|
||||
- '&7------------------------------'
|
||||
- '&6玩家名称: &a%player_displayname%'
|
||||
- '&7------------------------------'
|
||||
- '&6您所在的位置: &b%player_world% &a%player_x%,%player_y%,%player_z%'
|
||||
|
Loading…
Reference in New Issue
Block a user