Rework of remaining Listeners
Dieser Commit ist enthalten in:
Ursprung
78ff15831c
Commit
78f78fb6da
@ -14,19 +14,15 @@ public class BlockBreakListener implements Listener {
|
||||
public void handleBlockBreak(BlockBreakEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if(Fight.getPlayerTeam(player) == null) {
|
||||
if(Fight.getPlayerTeam(player) == null)
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if(FightSystem.getPlugin().getFightState() != FightState.RUNNING) {
|
||||
else if(FightSystem.getPlugin().getFightState() != FightState.RUNNING) {
|
||||
event.setCancelled(true);
|
||||
if(FightSystem.getPlugin().getFightState() == FightState.RUNNING || FightSystem.getPlugin().getFightState() == FightState.PRE_RUNNING) {
|
||||
player.sendMessage(FightSystem.PREFIX + "§cDu darfst erst nach Fightbeginn Blöcke setzen!");
|
||||
if(FightSystem.getPlugin().getFightState() == FightState.PRE_RUNNING) {
|
||||
player.sendMessage(FightSystem.PREFIX + "§cDu darfst erst nach Fightbeginn Blöcke abbauen!");
|
||||
} else
|
||||
player.sendMessage(FightSystem.PREFIX + "§cDu darfst keine Blöcke mehr setzen!");
|
||||
return;
|
||||
player.sendMessage(FightSystem.PREFIX + "§cDu darfst keine Blöcke mehr abbauen!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -14,19 +14,14 @@ public class BlockPlaceListener implements Listener {
|
||||
public void handleBlockPlace(BlockPlaceEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if(Fight.getPlayerTeam(player) == null) {
|
||||
if(Fight.getPlayerTeam(player) == null)
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if(FightSystem.getPlugin().getFightState() != FightState.RUNNING) {
|
||||
else if(FightSystem.getPlugin().getFightState() != FightState.RUNNING) {
|
||||
event.setCancelled(true);
|
||||
if(FightSystem.getPlugin().getFightState() == FightState.PRE_RUNNING) {
|
||||
player.sendMessage(FightSystem.PREFIX + "§cDu darfst erst nach Fightbeginn Blöcke setzen!");
|
||||
} else
|
||||
player.sendMessage(FightSystem.PREFIX + "§cDu darfst keine Blöcke mehr setzen!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -22,17 +22,13 @@ public class PlayerDeathListener implements Listener {
|
||||
fightTeam.getFightPlayer(player).setOut(true);
|
||||
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDer Spieler §6" + player.getName() + " §cist gestorben!");
|
||||
if(fightTeam.allPlayersOut()) {
|
||||
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cAlle Spieler aus dem Team von " + fightTeam.getLeader().getPlayer().getName() + " §csind gestorben!");
|
||||
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cAlle Spieler aus dem Team " + fightTeam.getLeader().getPlayer().getName() + " §csind gestorben!");
|
||||
instance.setSpectateState(oppositeFightTeam);
|
||||
return;
|
||||
} else {
|
||||
if(Fight.getPlayerTeam(player) == Fight.redTeam){
|
||||
player.teleport(instance.getFightManager().getRedTeleportLocation());
|
||||
return;
|
||||
}
|
||||
if(Fight.getPlayerTeam(player) == Fight.blueTeam) {
|
||||
player.teleport(instance.getFightManager().getRedTeleportLocation());
|
||||
return;
|
||||
}else{
|
||||
player.teleport(instance.getFightManager().getBlueTeleportLocation());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ public class PlayerQuitListener implements Listener {
|
||||
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cAlle Spieler aus dem Team von §6" + fightTeam.getLeader().getPlayer() + " §chaben den Kampf verlassen! \n §4Stoppe Server in 30 Sekunden...");
|
||||
Countdown countdown = new Countdown(30*20, new FinishNoPlayersOnline());
|
||||
countdown.startTimer(FightSystem.getPlugin());
|
||||
return;
|
||||
} else {
|
||||
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cAlle Spieler aus dem Team von §6" + fightTeam.getLeader().getPlayer() + " §csind tot oder haben den Kampf verlassen! \n §60 Sekunden Zeit zum Begutachten!");
|
||||
FightSystem.getPlugin().setSpectateState(Fight.getOpposite(fightTeam));
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren