Skip to content

Commit e541140

Browse files
committed
remove remaining time for vanilla clients after game ends
1 parent 3486d9c commit e541140

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

common/src/main/java/io/github/gaming32/bingo/game/BingoGame.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)