Dieser Commit ist enthalten in:
Ursprung
6ce6967175
Commit
2c8ba8ddf1
@ -31,6 +31,7 @@ public class Leaderboard implements Listener {
|
|||||||
private final Location location;
|
private final Location location;
|
||||||
private final int best;
|
private final int best;
|
||||||
private long bestTime;
|
private long bestTime;
|
||||||
|
private final List<REntity> entities = new ArrayList<>();
|
||||||
private final Map<Integer, REntityServer> playerPlacements = new HashMap<>();
|
private final Map<Integer, REntityServer> playerPlacements = new HashMap<>();
|
||||||
|
|
||||||
public Leaderboard(REntityServer server, String configKey, Location location, int best) {
|
public Leaderboard(REntityServer server, String configKey, Location location, int best) {
|
||||||
@ -43,7 +44,8 @@ public class Leaderboard implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void update() {
|
public void update() {
|
||||||
server.getEntities().forEach(REntity::die);
|
entities.forEach(REntity::die);
|
||||||
|
entities.clear();
|
||||||
List<LeaderboardEntry> leaderboard = getLeaderboard();
|
List<LeaderboardEntry> leaderboard = getLeaderboard();
|
||||||
if (leaderboard.isEmpty()) return;
|
if (leaderboard.isEmpty()) return;
|
||||||
bestTime = leaderboard.get(0).time;
|
bestTime = leaderboard.get(0).time;
|
||||||
@ -59,6 +61,7 @@ public class Leaderboard implements Listener {
|
|||||||
}
|
}
|
||||||
entity.setDisplayName(calcName(user, color, i + 1, entry.time));
|
entity.setDisplayName(calcName(user, color, i + 1, entry.time));
|
||||||
entity.setInvisible(true);
|
entity.setInvisible(true);
|
||||||
|
entities.add(entity);
|
||||||
}
|
}
|
||||||
Bukkit.getOnlinePlayers().forEach(player -> {
|
Bukkit.getOnlinePlayers().forEach(player -> {
|
||||||
updatePlayerPlacement(player, SteamwarUser.get(player.getUniqueId()));
|
updatePlayerPlacement(player, SteamwarUser.get(player.getUniqueId()));
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren