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

fix: 修复getScore()方法参数不得大于40字符的错误

Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
502647092 2016-08-08 20:13:08 +08:00
parent a5a581ec75
commit 840dd57056
2 changed files with 6 additions and 4 deletions

View File

@ -8,6 +8,7 @@ import java.util.List;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import cn.citycraft.PluginHelper.callback.CallBackReturn; import cn.citycraft.PluginHelper.callback.CallBackReturn;
import cn.citycraft.PluginHelper.kit.StrKit;
import cn.citycraft.PluginHelper.pluginapi.PluginAPI; import cn.citycraft.PluginHelper.pluginapi.PluginAPI;
import pw.yumc.MiaoBoard.model.BoardModel; import pw.yumc.MiaoBoard.model.BoardModel;
import pw.yumc.MiaoBoard.scoreboard.ScoreBoardManager; import pw.yumc.MiaoBoard.scoreboard.ScoreBoardManager;
@ -28,7 +29,7 @@ public class BodyUpdater extends CallBackReturn.One<Player, List<String>> {
if (param.hasPermission(bmodel.permission)) { if (param.hasPermission(bmodel.permission)) {
final List<String> temp = new LinkedList<>(); final List<String> temp = new LinkedList<>();
for (final String line : bmodel.lines) { for (final String line : bmodel.lines) {
temp.add(PluginAPI.PlaceholderAPI(param, line)); temp.add(StrKit.substring(PluginAPI.PlaceholderAPI(param, line), 0, 40));
} }
return temp; return temp;
} }

View File

@ -5,6 +5,7 @@ import java.util.Iterator;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import cn.citycraft.PluginHelper.callback.CallBackReturn; import cn.citycraft.PluginHelper.callback.CallBackReturn;
import cn.citycraft.PluginHelper.kit.StrKit;
import cn.citycraft.PluginHelper.pluginapi.PluginAPI; import cn.citycraft.PluginHelper.pluginapi.PluginAPI;
import pw.yumc.MiaoBoard.model.BoardModel; import pw.yumc.MiaoBoard.model.BoardModel;
import pw.yumc.MiaoBoard.scoreboard.ScoreBoardManager; import pw.yumc.MiaoBoard.scoreboard.ScoreBoardManager;
@ -23,7 +24,7 @@ public class TitleUpdater extends CallBackReturn.One<Player, String> {
while (iterator.hasNext()) { while (iterator.hasNext()) {
final BoardModel bmodel = iterator.next(); final BoardModel bmodel = iterator.next();
if (param.hasPermission(bmodel.permission)) { if (param.hasPermission(bmodel.permission)) {
return PluginAPI.PlaceholderAPI(param, bmodel.title); return StrKit.substring(PluginAPI.PlaceholderAPI(param, bmodel.title), 0, 40);
} }
} }
return ""; return "";