Fix FightScoreboard #17
@ -50,19 +50,15 @@ class FightScoreboard {
|
||||
objective.setDisplaySlot(DisplaySlot.SIDEBAR);
|
||||
objective.setDisplayName("§eSpieler");
|
||||
|
||||
teamScoreboard(MissileWars.getBlueTeam());
|
||||
teamScoreboard(MissileWars.getRedTeam());
|
||||
|
||||
MissileWars.getBlueTeam().teamScoreboard(objective);
|
||||
MissileWars.getRedTeam().teamScoreboard(objective);
|
||||
|
||||
Bukkit.getOnlinePlayers().forEach(player -> player.setScoreboard(scoreboard));
|
||||
}, 0, 200);
|
||||
}, 0, 50);
|
||||
}
|
||||
|
||||
static Scoreboard getScoreboard() {
|
||||
return scoreboard;
|
||||
}
|
||||
|
||||
private static void teamScoreboard(MWTeam fightTeam){
|
||||
fightTeam.getPlayers().forEach(p -> objective.getScore(fightTeam.getPrefix() + p.getName()).setScore(1));
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.scoreboard.Objective;
|
||||
import org.bukkit.scoreboard.Team;
|
||||
|
||||
import java.util.LinkedList;
|
||||
@ -93,6 +94,10 @@ public class MWTeam {
|
||||
}
|
||||
}
|
||||
|
||||
public void teamScoreboard(Objective objective) {
|
||||
players.forEach(p -> objective.getScore(getPrefix() + p.getName()).setScore(1));
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return players.size();
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren