1
0
mirror of https://e.coding.net/circlecloud/MiaoBoard.git synced 2024-12-22 06:49:02 +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,13 +8,14 @@ import java.util.List;
import org.bukkit.entity.Player;
import cn.citycraft.PluginHelper.callback.CallBackReturn;
import cn.citycraft.PluginHelper.kit.StrKit;
import cn.citycraft.PluginHelper.pluginapi.PluginAPI;
import pw.yumc.MiaoBoard.model.BoardModel;
import pw.yumc.MiaoBoard.scoreboard.ScoreBoardManager;
/**
* 记分板行更新类
*
*
* @since 2016年7月4日 下午4:47:17
* @author
*/
@ -28,7 +29,7 @@ public class BodyUpdater extends CallBackReturn.One<Player, List<String>> {
if (param.hasPermission(bmodel.permission)) {
final List<String> temp = new LinkedList<>();
for (final String line : bmodel.lines) {
temp.add(PluginAPI.PlaceholderAPI(param, line));
temp.add(StrKit.substring(PluginAPI.PlaceholderAPI(param, line), 0, 40));
}
return temp;
}

View File

@ -5,13 +5,14 @@ import java.util.Iterator;
import org.bukkit.entity.Player;
import cn.citycraft.PluginHelper.callback.CallBackReturn;
import cn.citycraft.PluginHelper.kit.StrKit;
import cn.citycraft.PluginHelper.pluginapi.PluginAPI;
import pw.yumc.MiaoBoard.model.BoardModel;
import pw.yumc.MiaoBoard.scoreboard.ScoreBoardManager;
/**
* 记分板标题更新类
*
*
* @since 2016年7月4日 下午4:47:17
* @author
*/
@ -23,7 +24,7 @@ public class TitleUpdater extends CallBackReturn.One<Player, String> {
while (iterator.hasNext()) {
final BoardModel bmodel = iterator.next();
if (param.hasPermission(bmodel.permission)) {
return PluginAPI.PlaceholderAPI(param, bmodel.title);
return StrKit.substring(PluginAPI.PlaceholderAPI(param, bmodel.title), 0, 40);
}
}
return "";