Skip to content

Commit

Permalink
Added starting & waiting to tier placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
MetallicGoat committed Nov 19, 2021
1 parent c3e394d commit ef794c9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/main/java/me/metallicgoat/MBedwarsTweaks/Placeholders.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,26 @@ public String onRequest(OfflinePlayer player, @NotNull String params) {
Arena arena = BedwarsAPI.getGameAPI().getArenaByPlayer(player1);
if (arena != null) {

String nextTierName = GenTiers.nextTierMap.get(arena);
String nextTierTime = GenTiers.timeLeft(arena);

switch (arena.getStatus()) {
case LOBBY:
return "Game is still in Lobby";
int time = (int) arena.getLobbyTimeRemaining();
if(time > 0){
//Waiting
return Message.build(ServerManager.getConfig().getString("Next-Tier-Placeholder-Lobby-Starting")).placeholder("time", time).done();
}else{
//Starting
return Message.build(ServerManager.getConfig().getString("Next-Tier-Placeholder-Lobby-Waiting")).done();
}
case END_LOBBY:
return "Game Ended";
case STOPPED:
return "Game Stopped";
case RESETTING:
return "Game Resetting";
case RUNNING:
String nextTierName = GenTiers.nextTierMap.get(arena);
String nextTierTime = GenTiers.timeLeft(arena);

return Message.build(ServerManager.getConfig().getString("Next-Tier-Placeholder"))
.placeholder("next-tier", nextTierName)
.placeholder("time", nextTierTime)
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ Spawner-Title:
# {next-tier} {time}
Next-Tier-Placeholder: '{next-tier} in &a{time}'

Next-Tier-Placeholder-Lobby-Starting: "&fStarting in &a{time}s"

Next-Tier-Placeholder-Lobby-Waiting: "&fWaiting..."

############### BED BREAK ###############

#Message displayed when any bed is broken (to everyone in the arena)
Expand Down

0 comments on commit ef794c9

Please sign in to comment.