mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-11-23 11:06:14 +01:00
Add zero-score fix to the dead players on the scoreboards.
This commit is contained in:
parent
9e3848ce41
commit
8f95745b50
@ -70,8 +70,23 @@ public class ScoreboardManager {
|
||||
int value = kills.getScore(player).getScore();
|
||||
scoreboard.resetScores(player);
|
||||
|
||||
Score fake = kills.getScore(Bukkit.getOfflinePlayer(name));
|
||||
fake.setScore(value);
|
||||
/* In case the player has no kills, they will not show up on the
|
||||
* scoreboard unless they are first given a different score.
|
||||
* If zero kills, the score is set to 8 (which looks a bit like
|
||||
* 0), and then in the next tick, it's set to 0. Otherwise, the
|
||||
* score is just set to its current value.
|
||||
*/
|
||||
final Score fake = kills.getScore(Bukkit.getOfflinePlayer(name));
|
||||
if (value == 0) {
|
||||
fake.setScore(8);
|
||||
arena.scheduleTask(new Runnable() {
|
||||
public void run() {
|
||||
fake.setScore(0);
|
||||
}
|
||||
}, 1);
|
||||
} else {
|
||||
fake.setScore(value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user