Fix FightScoreboard #17
@ -50,19 +50,15 @@ class FightScoreboard {
|
|||||||
objective.setDisplaySlot(DisplaySlot.SIDEBAR);
|
objective.setDisplaySlot(DisplaySlot.SIDEBAR);
|
||||||
objective.setDisplayName("§eSpieler");
|
objective.setDisplayName("§eSpieler");
|
||||||
|
|
||||||
teamScoreboard(MissileWars.getBlueTeam());
|
MissileWars.getBlueTeam().teamScoreboard(objective);
|
||||||
teamScoreboard(MissileWars.getRedTeam());
|
MissileWars.getRedTeam().teamScoreboard(objective);
|
||||||
|
|
||||||
|
|
||||||
Bukkit.getOnlinePlayers().forEach(player -> player.setScoreboard(scoreboard));
|
Bukkit.getOnlinePlayers().forEach(player -> player.setScoreboard(scoreboard));
|
||||||
}, 0, 200);
|
}, 0, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Scoreboard getScoreboard() {
|
static Scoreboard getScoreboard() {
|
||||||
return scoreboard;
|
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.Inventory;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
import org.bukkit.scoreboard.Objective;
|
||||||
import org.bukkit.scoreboard.Team;
|
import org.bukkit.scoreboard.Team;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
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() {
|
public int size() {
|
||||||
return players.size();
|
return players.size();
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren