Skip to content

Commit

Permalink
feat: %countdownwaiting% placeholder, closes #500 + game creator fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Misat11 committed Jun 22, 2024
1 parent ad454f5 commit 8b44e5b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ buildConfig {
}

prepareTestTask()
.versions('1.20.6', '1.20.4', '1.20.2', '1.20.1', '1.19.4', '1.19.3', '1.18.2', '1.17.1', '1.16.5', '1.15.2', '1.14.4', '1.13.2', '1.12.2', '1.11.2', '1.10.2', '1.9.4', '1.8.8')
.versions('1.21', '1.20.6', '1.20.4', '1.20.2', '1.20.1', '1.19.4', '1.19.3', '1.18.2', '1.17.1', '1.16.5', '1.15.2', '1.14.4', '1.13.2', '1.12.2', '1.11.2', '1.10.2', '1.9.4', '1.8.8')
.setSubdirectory("paper-0-2-x-branch")
.jvmArgs('-Dio.papermc.paper.suppress.sout.nags=true', '-DPaper.IgnoreJavaVersion=true') // suppress System.out.println nag
.onlineMode(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2787,6 +2787,11 @@ private String formatLobbyScoreboardString(String str) {
finalStr = finalStr.replace("%players%", String.valueOf(players.size()));
finalStr = finalStr.replace("%maxplayers%", String.valueOf(calculatedMaxPlayers));
finalStr = finalStr.replace("%countdown%", String.valueOf(countdown));
finalStr = finalStr.replace("%countdownwaiting%",
players.size() >= getMinPlayers() && (teamsInGame.size() > 1 || (getOriginalOrInheritedJoinRandomTeamAfterLobby() && countRespawnable() < players.size()))
? String.valueOf(countdown)
: i18nonly("waiting_placeholder_lobby_scoreboard")
);

return finalStr;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ public String setPos1(Location loc, boolean force) {
continue;
}

if (game.getPos2() != null && arenaOverlaps(game1.getPos1(), game1.getPos2(), loc, game.getPos2()) || game.getPos2() == null && isInArea(game1.getPos1(), game1.getPos2(), loc)) {
if (game.getPos2() != null && arenaOverlaps(game1.getPos1(), game1.getPos2(), loc, game.getPos2()) || game.getPos2() == null && isInArea(loc, game1.getPos1(), game1.getPos2())) {
return i18n("admin_arena_overlaps").replace("%arena%", game.getName()).replace("%position%", "pos1");
}
}
Expand Down Expand Up @@ -943,7 +943,7 @@ public String setPos2(Location loc, boolean force) {
continue;
}

if (game.getPos1() != null && arenaOverlaps(game1.getPos1(), game1.getPos2(), game.getPos1(), loc) || game.getPos1() == null && isInArea(game1.getPos1(), game1.getPos2(), loc)) {
if (game.getPos1() != null && arenaOverlaps(game1.getPos1(), game1.getPos2(), game.getPos1(), loc) || game.getPos1() == null && isInArea(loc, game1.getPos1(), game1.getPos2())) {
return i18n("admin_arena_overlaps").replace("%arena%", game.getName()).replace("%position%", "pos2");
}
}
Expand Down
3 changes: 2 additions & 1 deletion plugin/src/main/resources/languages/language_en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -372,4 +372,5 @@ help_bw_cheatin_give: "/bw cheatIn <game> give <resource> <amount> <player> - &c
help_bw_cheatin_kill: "/bw cheatIn <game> kill <player> - &cKills specified player"
help_bw_cheatin_destroybed: "/bw cheatIn <game> destroybed <team> - &cDestroys bed of the specific team"
help_bw_cheatin_destroyallbeds: "/bw cheatIn <game> destroyallbeds - &cDestroys all beds in the game"
admin_arena_overlaps: "&cThe chosen location causes the arena to overlap with another arena, which can lead to errors! Please choose a different location. If you insist on using this location, execute &7/bw admin %arena% %position% force"
admin_arena_overlaps: "&cThe chosen location causes the arena to overlap with another arena, which can lead to errors! Please choose a different location. If you insist on using this location, execute &7/bw admin %arena% %position% force"
waiting_placeholder_lobby_scoreboard: "Waiting..."

0 comments on commit 8b44e5b

Please sign in to comment.