9
0
mirror of https://github.com/Xiao-MoMi/Custom-Nameplates.git synced 2025-12-27 02:49:05 +00:00

Update ScoreBoardManager.java

This commit is contained in:
Xiao-MoMi
2022-06-21 22:54:53 +08:00
parent 025bba917b
commit 847ee316a4

View File

@@ -10,14 +10,8 @@ import java.util.Map;
public class ScoreBoardManager {
private final CustomNameplates plugin;
/*
虽然会内存占用会随着玩家数量持续增加,但是这点内存根本不值一提
*/
private final Map<String, NameplatesTeam> teams;
/*
该类存在的意义是判断玩家是否已经
*/
public ScoreBoardManager(CustomNameplates plugin) {
this.teams = new HashMap<>();
this.plugin = plugin;
@@ -27,7 +21,6 @@ public class ScoreBoardManager {
if (!this.teams.containsKey(player.getName())) {
this.teams.put(player.getName(), new NameplatesTeam(this.plugin, player));
}
//延后一秒确保数据库完成请求
Bukkit.getScheduler().runTaskLater(this.plugin, () -> this.getTeam(player.getName()).updateNameplates(), 20);
return this.teams.get(player.getName());
}