Remove entries properly and create objective on creative.

This commit is contained in:
ulumulu1510 2016-10-10 15:58:46 +02:00 committed by Olof Larsson
parent 04cdb09a1a
commit d86e069262
No known key found for this signature in database
GPG Key ID: BBEF14F97DA52474

View File

@ -356,7 +356,7 @@ public class BoardUtil extends Engine
public static Objective getObjective(Scoreboard board, String id, boolean creative) public static Objective getObjective(Scoreboard board, String id, boolean creative)
{ {
Objective objective = board.getObjective(id); Objective objective = board.getObjective(id);
if (objective == null && creative) createObjective(board, id); if (objective == null && creative) objective = createObjective(board, id);
return objective; return objective;
} }
@ -520,10 +520,11 @@ public class BoardUtil extends Engine
} }
// Remove // Remove
for (String key : objective.getScoreboard().getEntries()) Scoreboard board = objective.getScoreboard();
for (String key : board.getEntries())
{ {
if (entries.containsKey(key)) continue; if (entries.containsKey(key)) continue;
ret |= setObjectiveValue(objective, key, 0); board.resetScores(key);
} }
return ret; return ret;