update kill best surviving team event
This commit is contained in:
parent
6ebb48f7ce
commit
081502b64c
1 changed files with 23 additions and 3 deletions
|
@ -5,8 +5,10 @@ import gent.zeus.mc13dtl.events.Difficulty;
|
|||
import gent.zeus.mc13dtl.events.Event;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.scoreboard.Team;
|
||||
|
||||
public class KillSurvivingTeamEvent extends Event {
|
||||
|
@ -28,12 +30,30 @@ public class KillSurvivingTeamEvent extends Event {
|
|||
@EventHandler
|
||||
@Override
|
||||
public void onPlayerDeath(PlayerDeathEvent event) {
|
||||
if (MC13DTL.board.getPlayers(team).contains(event.getPlayer())) {
|
||||
if (MC13DTL.board.getPlayers(huntingTeam).contains(event.getPlayer())) {
|
||||
if (team.getName().equals(huntingTeam.getName())) {
|
||||
eventFailed();
|
||||
} else if (MC13DTL.board.getPlayers(huntingTeam).contains(event.getPlayer())) {
|
||||
} else {
|
||||
eventSuccess();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void eventTimeEnded() {
|
||||
if (team.getName().equals(huntingTeam.getName())) {
|
||||
eventSuccess();
|
||||
} else {
|
||||
eventFailed();
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerQuit(PlayerQuitEvent event) {
|
||||
if (team.getName().equals(huntingTeam.getName()) && MC13DTL.board.getPlayers(team).contains(event.getPlayer())) {
|
||||
eventFailed();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getMessage() {
|
||||
|
|
Loading…
Reference in a new issue