Skip to content

Commit

Permalink
Drop flag if player leaves arena
Browse files Browse the repository at this point in the history
  • Loading branch information
Redned235 committed Jul 11, 2024
1 parent 946d05e commit ba3ddd8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/org/battleplugins/arena/ctf/arena/CtfArena.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.battleplugins.arena.event.arena.ArenaPhaseCompleteEvent;
import org.battleplugins.arena.event.arena.ArenaPhaseStartEvent;
import org.battleplugins.arena.event.player.ArenaDeathEvent;
import org.battleplugins.arena.event.player.ArenaLeaveEvent;

public class CtfArena extends Arena {

Expand Down Expand Up @@ -50,4 +51,11 @@ public void onDeath(ArenaDeathEvent event) {
ctfCompetition.dropFlag(event.getArenaPlayer());
}
}

@ArenaEventHandler
public void onDeath(ArenaLeaveEvent event) {
if (event.getCompetition() instanceof CtfCompetition ctfCompetition) {
ctfCompetition.dropFlag(event.getArenaPlayer());
}
}
}

0 comments on commit ba3ddd8

Please sign in to comment.