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) {
|
public void handleBlockBreak(BlockBreakEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
if(Fight.getPlayerTeam(player) == null) {
|
if(Fight.getPlayerTeam(player) == null)
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
else if(FightSystem.getPlugin().getFightState() != FightState.RUNNING) {
|
||||||
}
|
|
||||||
if(FightSystem.getPlugin().getFightState() != FightState.RUNNING) {
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
if(FightSystem.getPlugin().getFightState() == FightState.RUNNING || FightSystem.getPlugin().getFightState() == FightState.PRE_RUNNING) {
|
if(FightSystem.getPlugin().getFightState() == FightState.PRE_RUNNING) {
|
||||||
player.sendMessage(FightSystem.PREFIX + "§cDu darfst erst nach Fightbeginn Blöcke setzen!");
|
player.sendMessage(FightSystem.PREFIX + "§cDu darfst erst nach Fightbeginn Blöcke abbauen!");
|
||||||
} else
|
} else
|
||||||
player.sendMessage(FightSystem.PREFIX + "§cDu darfst keine Blöcke mehr setzen!");
|
player.sendMessage(FightSystem.PREFIX + "§cDu darfst keine Blöcke mehr abbauen!");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,19 +14,14 @@ public class BlockPlaceListener implements Listener {
|
|||||||
public void handleBlockPlace(BlockPlaceEvent event) {
|
public void handleBlockPlace(BlockPlaceEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
if(Fight.getPlayerTeam(player) == null) {
|
if(Fight.getPlayerTeam(player) == null)
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
else if(FightSystem.getPlugin().getFightState() != FightState.RUNNING) {
|
||||||
}
|
|
||||||
if(FightSystem.getPlugin().getFightState() != FightState.RUNNING) {
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
if(FightSystem.getPlugin().getFightState() == FightState.PRE_RUNNING) {
|
if(FightSystem.getPlugin().getFightState() == FightState.PRE_RUNNING) {
|
||||||
player.sendMessage(FightSystem.PREFIX + "§cDu darfst erst nach Fightbeginn Blöcke setzen!");
|
player.sendMessage(FightSystem.PREFIX + "§cDu darfst erst nach Fightbeginn Blöcke setzen!");
|
||||||
} else
|
} else
|
||||||
player.sendMessage(FightSystem.PREFIX + "§cDu darfst keine Blöcke mehr setzen!");
|
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);
|
fightTeam.getFightPlayer(player).setOut(true);
|
||||||
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDer Spieler §6" + player.getName() + " §cist gestorben!");
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDer Spieler §6" + player.getName() + " §cist gestorben!");
|
||||||
if(fightTeam.allPlayersOut()) {
|
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);
|
instance.setSpectateState(oppositeFightTeam);
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
if(Fight.getPlayerTeam(player) == Fight.redTeam) {
|
if(Fight.getPlayerTeam(player) == Fight.redTeam){
|
||||||
player.teleport(instance.getFightManager().getRedTeleportLocation());
|
player.teleport(instance.getFightManager().getRedTeleportLocation());
|
||||||
return;
|
}else{
|
||||||
}
|
player.teleport(instance.getFightManager().getBlueTeleportLocation());
|
||||||
if(Fight.getPlayerTeam(player) == Fight.blueTeam) {
|
|
||||||
player.teleport(instance.getFightManager().getRedTeleportLocation());
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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...");
|
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 countdown = new Countdown(30*20, new FinishNoPlayersOnline());
|
||||||
countdown.startTimer(FightSystem.getPlugin());
|
countdown.startTimer(FightSystem.getPlugin());
|
||||||
return;
|
|
||||||
} else {
|
} 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!");
|
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));
|
FightSystem.getPlugin().setSpectateState(Fight.getOpposite(fightTeam));
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren