mirror of
https://github.com/garbagemule/MobArena.git
synced 2025-01-11 02:49:07 +01:00
Guard against null scores for players who manage to die in the lobby. Fixes #319
This commit is contained in:
parent
7e049cdae6
commit
acbeb3d77f
@ -62,12 +62,21 @@ public class ScoreboardManager {
|
||||
* @param player a player
|
||||
*/
|
||||
void death(Player player) {
|
||||
if (kills == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String name = ChatColor.GRAY + player.getName();
|
||||
if (name.length() > 16) {
|
||||
name = name.substring(0, 15);
|
||||
}
|
||||
|
||||
int value = kills.getScore(player).getScore();
|
||||
Score score = kills.getScore(player);
|
||||
if (score == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
int value = score.getScore();
|
||||
scoreboard.resetScores(player);
|
||||
|
||||
/* In case the player has no kills, they will not show up on the
|
||||
|
Loading…
Reference in New Issue
Block a user