1
0
mirror of https://e.coding.net/circlecloud/MiaoBoard.git synced 2024-11-22 01:49:05 +00:00

feat: compatible to 1.19

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
MiaoWoo 2022-06-24 18:15:18 +00:00
parent 3f193bbf46
commit 00db90be47
5 changed files with 88 additions and 77 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>MiaoBoard</artifactId>
<version>2.5.1</version>
<version>2.6.0</version>
<description>喵式记分板</description>
<parent>
@ -13,8 +13,10 @@
</parent>
<properties>
<update.description>§a正式版本 2.5.1</update.description>
<update.description>§a正式版本 兼容 1.19 版本</update.description>
<update.changes>
§622-06-25 §afeat: 兼容 1.19 版本;
§621-06-23 §afeat: 解除32个字符限制(1.13+);
§621-05-31 §cfix: 修复记分板切换异常问题;
§619-12-30 §cfix: 修复字符截取错误导致的报错;
§619-10-24 §cfix: 调整默认配置的 time.end 为2099年;

View File

@ -3,7 +3,6 @@ package pw.yumc.MiaoBoard;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import pw.yumc.MiaoBoard.listener.PlayerListener;
import pw.yumc.MiaoBoard.listener.SelfListener;
import pw.yumc.MiaoBoard.misc.Checker;

View File

@ -2,11 +2,13 @@ package pw.yumc.MiaoBoard.scoreboard.core;
import org.apache.commons.lang.Validate;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
import org.bukkit.scoreboard.DisplaySlot;
import org.bukkit.scoreboard.Objective;
import org.bukkit.scoreboard.Team;
import pw.yumc.MiaoBoard.misc.FakePlayer;
import pw.yumc.YumCore.bukkit.Log;
import pw.yumc.YumCore.kit.StrKit;
import java.util.ArrayList;
@ -19,8 +21,8 @@ import java.util.List;
*/
public class SidebarBoardPage extends BoardPage {
private static final List<ChatColor> COLORS = Arrays.asList(ChatColor.values());
private static final int BOARD_LINE_MAX_CHARS = 16;
private static final int BOARD_LINE_MAX_CHARS_SUB1 = BOARD_LINE_MAX_CHARS - 1;
private static int BOARD_LINE_MAX_CHARS = 16;
private static int BOARD_LINE_MAX_CHARS_SUB1 = BOARD_LINE_MAX_CHARS - 1;
private static boolean newVer = true;
static {
@ -29,6 +31,13 @@ public class SidebarBoardPage extends BoardPage {
} catch (NoSuchMethodException e) {
newVer = false;
}
try {
Material.valueOf("KELP");
BOARD_LINE_MAX_CHARS = 64;
BOARD_LINE_MAX_CHARS_SUB1 = BOARD_LINE_MAX_CHARS - 1;
Log.console("§a当前服务端支持新版记分板 长度限制为128个字符...");
} catch (IllegalArgumentException e) {
}
}
private final Objective objective;

View File

@ -20,7 +20,7 @@ Boards:
title: '玩家信息'
#记分板权限
permission: mb.default
#记分板内容(不得超过38字符 包括颜色字符 超过部分自动截取)
#记分板内容(不得超过32个字符(1.13+限制为128字符) 包括颜色字符 超过部分自动截取)
lines:
- '&6名 称: &a%player_displayname%'
- '&6世 界: &b%player_world%'
@ -38,7 +38,7 @@ Boards:
title: '服务器信息'
#记分板权限
permission: mb.reload
#记分板内容(不得超过38字符 包括颜色字符 超过部分自动截取)
#记分板内容(不得超过32个字符(1.13+限制为128字符) 包括颜色字符 超过部分自动截取)
lines:
- '&6名 称: &a%plugin_name%'
- '&6版 本: &b%plugin_version%'

View File

@ -1,6 +1,7 @@
name: ${project.artifactId}
description: ${project.description}
main: ${project.groupId}.${project.artifactId}.${project.artifactId}
api-version: 1.13
version: ${project.version}-git-${env.GIT_COMMIT}
author: 喵♂呜
website: ${ciManagement.url}