File tree Expand file tree Collapse file tree
common/src/main/java/io/github/gaming32/bingo/game Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -199,15 +199,21 @@ public void updateRemainingTime(MinecraftServer server) {
199199 }
200200
201201 public void updateVanillaRemainingTime (MinecraftServer server ) {
202- if (vanillaRemainingTime .getPlayers ().isEmpty ())
202+ if (vanillaRemainingTime .getPlayers ().isEmpty ()) {
203203 return ;
204+ }
204205 long remainingTimeTicks = getScheduledEndTime () - server .overworld ().getGameTime ();
205206 String formatedRemainingTime = BingoUtil .formatRemainingTime (remainingTimeTicks );
207+ if (remainingTimeTicks <= 0 ) {
208+ vanillaRemainingTime .removeAllPlayers ();
209+ return ;
210+ }
206211 BossEvent .BossBarColor color = BossEvent .BossBarColor .WHITE ;
207- if (remainingTimeTicks < 30 * 60 * 20 )
208- color = BossEvent .BossBarColor .PURPLE ;
209- if (remainingTimeTicks < 5 * 60 * 20 )
212+ if (remainingTimeTicks < 5 * 60 * 20 ) {
210213 color = BossEvent .BossBarColor .RED ;
214+ } else if (remainingTimeTicks < 30 * 60 * 20 ) {
215+ color = BossEvent .BossBarColor .PURPLE ;
216+ }
211217 vanillaRemainingTime .setName (Bingo .translatable ("bingo.remaining_time_with_value" , formatedRemainingTime ));
212218 vanillaRemainingTime .setColor (color );
213219 }
You can’t perform that action at this time.
0 commit comments