Updates the placeholder info to include parkour records

This commit is contained in:
2023-04-15 19:24:22 +02:00
parent 257fc48912
commit 6950246134
5 changed files with 14 additions and 9 deletions

View File

@ -171,7 +171,7 @@ public abstract class ArenaGroup<K extends Arena, S extends ArenaGroup<K, S>> im
* @return <p>True if the player is allowed to play the arena</p>
* @throws IllegalArgumentException <p>If checking an arena not in this group</p>
*/
public boolean canPlay(ArenaGameMode gameMode, Player player, UUID arenaId) throws IllegalArgumentException {
public boolean cannotPlay(ArenaGameMode gameMode, Player player, UUID arenaId) throws IllegalArgumentException {
if (!this.arenas.contains(arenaId)) {
throw new IllegalArgumentException("Cannot check for playability for arena not in this group!");
}
@ -179,7 +179,7 @@ public abstract class ArenaGroup<K extends Arena, S extends ArenaGroup<K, S>> im
for (UUID anArenaId : this.getArenas()) {
// If the target arena is reached, allow, as all previous arenas must have been cleared
if (arenaId.equals(anArenaId)) {
return true;
return false;
}
K arena = this.arenaHandler.getArena(anArenaId);
@ -192,11 +192,11 @@ public abstract class ArenaGroup<K extends Arena, S extends ArenaGroup<K, S>> im
// This is a lower-numbered arena the player has yet to complete
if (arena.getData().hasNotCompleted(gameMode, player)) {
return false;
return true;
}
}
return false;
return true;
}
/**

View File

@ -25,7 +25,11 @@ public enum ParkourArenaGameMode implements ConfigurationSerializable, ArenaGame
* @return <p>The specified arena game-mode</p>
*/
public static @NotNull ParkourArenaGameMode matchGamemode(@NotNull String gameMode) {
return ParkourArenaGameMode.DEFAULT;
try {
return ParkourArenaGameMode.valueOf(gameMode.toUpperCase());
} catch (IllegalArgumentException exception) {
return ParkourArenaGameMode.DEFAULT;
}
}
@NotNull

View File

@ -124,7 +124,7 @@ public class JoinDropperArenaCommand implements CommandExecutor {
// Require that the player has beaten the previous arena on the same game-mode before trying this one
if (configuration.mustDoGroupedInSequence() &&
!arenaGroup.canPlay(arenaGameMode, player, dropperArena.getArenaId())) {
arenaGroup.cannotPlay(arenaGameMode, player, dropperArena.getArenaId())) {
player.sendMessage("You have not yet beaten the previous arena!");
return false;
}

View File

@ -110,7 +110,7 @@ public class JoinParkourArenaCommand implements CommandExecutor {
// Require that the player has beaten the previous arena on the same game-mode before trying this one
if (configuration.mustDoGroupedInSequence() &&
!arenaGroup.canPlay(arenaGameMode, player, parkourArena.getArenaId())) {
arenaGroup.cannotPlay(arenaGameMode, player, parkourArena.getArenaId())) {
player.sendMessage("You have not yet beaten the previous arena!");
return false;
}