@@ -100,12 +100,14 @@ public class FastBoard {
100100 }
101101 }
102102
103- private Player player ;
104- private String id ;
103+ private final Player player ;
104+ private final String id ;
105105
106106 private String title ;
107107 private List <String > lines = new ArrayList <>();
108108
109+ private boolean deleted = false ;
110+
109111 /**
110112 * Create a new FastBoard for a player
111113 *
@@ -245,6 +247,10 @@ public Player getPlayer() {
245247 return player ;
246248 }
247249
250+ public boolean isDeleted () {
251+ return deleted ;
252+ }
253+
248254 /**
249255 * Delete this FastBoard, and will remove the scoreboard for the associated player if he is online.
250256 * After this, all uses of {@link #updateLines} and {@link #updateTitle} will throws an {@link IllegalStateException}
@@ -262,7 +268,7 @@ public void delete() {
262268 e .printStackTrace ();
263269 }
264270
265- player = null ;
271+ deleted = true ;
266272 }
267273
268274 private void sendObjectivePacket (ObjectiveMode mode ) throws ReflectiveOperationException {
@@ -349,7 +355,7 @@ private void sendTeamPacket(int score, TeamMode mode) throws ReflectiveOperation
349355 setField (packet , String .class , "always" , 5 ); // Collisions for 1.9+
350356
351357 if (mode == TeamMode .CREATE ) {
352- setField (packet , Collection .class , Collections .singleton (getColorCode (score ))); // Players in the team
358+ setField (packet , Collection .class , Collections .singletonList (getColorCode (score ))); // Players in the team
353359 }
354360 }
355361
@@ -361,7 +367,7 @@ private String getColorCode(int score) {
361367 }
362368
363369 private void sendPacket (Object packet ) throws ReflectiveOperationException {
364- if (player == null ) {
370+ if (deleted ) {
365371 throw new IllegalStateException ("This FastBoard is deleted" );
366372 }
367373
0 commit comments