From 3f193bbf460541fb71a29af94bca98f8317e2ea7 Mon Sep 17 00:00:00 2001 From: MiaoWoo Date: Mon, 31 May 2021 16:15:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=AE=B0=E5=88=86?= =?UTF-8?q?=E6=9D=BF=E5=88=87=E6=8D=A2=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MiaoWoo --- pom.xml | 8 +++--- .../scoreboard/core/SidebarBoardPage.java | 26 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index 51635cb..bdb97db 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 MiaoBoard - 2.5.0 + 2.5.1 喵式记分板 @@ -13,13 +13,15 @@ - §a正式版本 2.5.0 + §a正式版本 2.5.1 + §621-05-31 §cfix: 修复记分板切换异常问题; §619-12-30 §cfix: 修复字符截取错误导致的报错; §619-10-24 §cfix: 调整默认配置的 time.end 为2099年; - §618-03-05 §cfix: 修复1.12不兼容的问题 + §619-06-22 §afeat: 新增换行符的支持(欠费夏独家赞助更新) + §618-03-05 §cfix: 修复1.12不兼容的问题; §617-10-15 §cfix: 修复颜色字符分割错误; §617-08-15 §cfix: 修复事件未标记为异步的问题; §617-06-28 §cfix: 修复T端不兼容的问题; diff --git a/src/main/java/pw/yumc/MiaoBoard/scoreboard/core/SidebarBoardPage.java b/src/main/java/pw/yumc/MiaoBoard/scoreboard/core/SidebarBoardPage.java index f479c84..f6f0a03 100644 --- a/src/main/java/pw/yumc/MiaoBoard/scoreboard/core/SidebarBoardPage.java +++ b/src/main/java/pw/yumc/MiaoBoard/scoreboard/core/SidebarBoardPage.java @@ -1,24 +1,26 @@ package pw.yumc.MiaoBoard.scoreboard.core; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - import org.apache.commons.lang.Validate; import org.bukkit.ChatColor; 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.kit.StrKit; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + /** * @author 尘曲 * @since 2016年7月4日 下午4:40:21 */ public class SidebarBoardPage extends BoardPage { + private static final List 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 boolean newVer = true; static { @@ -29,12 +31,9 @@ public class SidebarBoardPage extends BoardPage { } } - private static final List 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 final Objective objective; private final List boardLines = new ArrayList<>(); - private int maxLine; + private int currentSize; public SidebarBoardPage() { super(); @@ -76,17 +75,16 @@ public class SidebarBoardPage extends BoardPage { } boardLine.getTeam().setPrefix(prefix); boardLine.getTeam().setSuffix(suffix); - maxLine = line + 1; } //all 5 [0 1 2 3 4] maxLine = 5 all 3 [0 1 2] maxLine=4 public void clear(int size) { - if (maxLine > size) { - for (int i = size; i < maxLine; i++) { - removeLine(i); + if (size < currentSize) { + for (int i = size; i < currentSize; i++) { + removeLine(i + 1); } - maxLine = size; } + currentSize = size; } public void removeLine(int line) {