mirror of
https://github.com/SunNetservers/MiniGames.git
synced 2025-09-17 11:27:55 +02:00
Adds a new item to allow arena re-tries
Prevents a NumberFormatException if the record number is invalid Updates Spigot to 1.20
This commit is contained in:
@@ -15,7 +15,7 @@ public abstract class AbstractArenaSession implements ArenaSession {
|
||||
private final @NotNull ArenaGameMode gameMode;
|
||||
private final @NotNull Player player;
|
||||
protected int deaths;
|
||||
protected final long startTime;
|
||||
protected long startTime;
|
||||
protected PlayerEntryState entryState;
|
||||
|
||||
/**
|
||||
@@ -47,6 +47,14 @@ public abstract class AbstractArenaSession implements ArenaSession {
|
||||
player.sendMessage(Message.SUCCESS_ARENA_QUIT.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
this.deaths = 0;
|
||||
this.startTime = System.currentTimeMillis();
|
||||
PlayerTeleporter.teleportPlayer(this.player, this.arena.getSpawnLocation(), false, false);
|
||||
this.entryState.setArenaState();
|
||||
}
|
||||
|
||||
/**
|
||||
* Announces a record set by this player
|
||||
*
|
||||
|
@@ -47,4 +47,9 @@ public interface ArenaSession {
|
||||
*/
|
||||
@NotNull ArenaGUI getGUI();
|
||||
|
||||
/**
|
||||
* Resets the session to allow a player to try again
|
||||
*/
|
||||
void reset();
|
||||
|
||||
}
|
||||
|
@@ -116,6 +116,12 @@ public class ParkourArenaSession extends AbstractArenaSession {
|
||||
return new ParkourGUI(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
this.reachedCheckpoint = null;
|
||||
super.reset();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void removeSession() {
|
||||
// Remove this session for game sessions to stop listeners from fiddling more with the player
|
||||
|
Reference in New Issue
Block a user