Kampfleiter /win command #267
@ -125,6 +125,7 @@ public class FightSystem extends JavaPlugin {
|
|||||||
new LockschemCommand();
|
new LockschemCommand();
|
||||||
new StateCommand();
|
new StateCommand();
|
||||||
new SkipCommand();
|
new SkipCommand();
|
||||||
|
new WinCommand();
|
||||||
|
|
||||||
new OneShotStateDependent(ArenaMode.All, FightState.PreRunning, () -> Bukkit.broadcastMessage(PREFIX + "§aDer Kampf beginnt!"));
|
new OneShotStateDependent(ArenaMode.All, FightState.PreRunning, () -> Bukkit.broadcastMessage(PREFIX + "§aDer Kampf beginnt!"));
|
||||||
new OneShotStateDependent(ArenaMode.All, FightState.Running, () -> Bukkit.broadcastMessage(PREFIX + "§aArena freigegeben!"));
|
new OneShotStateDependent(ArenaMode.All, FightState.Running, () -> Bukkit.broadcastMessage(PREFIX + "§aArena freigegeben!"));
|
||||||
|
@ -0,0 +1,49 @@
|
|||||||
|
package de.steamwar.fightsystem.commands;
|
||||||
|
|
||||||
|
import de.steamwar.fightsystem.ArenaMode;
|
||||||
|
import de.steamwar.fightsystem.FightSystem;
|
||||||
|
import de.steamwar.fightsystem.fight.Fight;
|
||||||
|
import de.steamwar.fightsystem.states.FightState;
|
||||||
|
import de.steamwar.fightsystem.states.StateDependentCommand;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public class WinCommand implements CommandExecutor {
|
||||||
|
|
||||||
|
public WinCommand() {
|
||||||
|
new StateDependentCommand(ArenaMode.Event, FightState.Ingame, "win", this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
|
if(!(sender instanceof Player)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Player p = (Player) sender;
|
||||||
|
|
||||||
|
if (p != FightSystem.getEventLeiter()) {
|
||||||
|
p.sendMessage(FightSystem.PREFIX + "§cDu bist kein Kampfleiter!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(args.length == 0){
|
||||||
|
p.sendMessage(FightSystem.PREFIX + "/win [Team or Tie]");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(args[0].equalsIgnoreCase(Fight.getBlueTeam().getName())){
|
||||||
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDer Kampfleiter hat den Kampf entschieden!");
|
||||||
Lixfel markierte diese Unterhaltung als gelöst
|
|||||||
|
FightSystem.setSpectateState(Fight.getBlueTeam(), "Referee");
|
||||||
|
}else if(args[0].equalsIgnoreCase(Fight.getRedTeam().getName())){
|
||||||
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDer Kampfleiter hat den Kampf entschieden!");
|
||||||
|
FightSystem.setSpectateState(Fight.getRedTeam(), "Referee");
|
||||||
|
}else if(args[0].equalsIgnoreCase("tie")){
|
||||||
|
Bukkit.broadcastMessage(FightSystem.PREFIX + "§cDer Kampfleiter hat den Kampf entschieden!");
|
||||||
|
FightSystem.setSpectateState(null, "Referee");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
In neuem Issue referenzieren
Einen Benutzer sperren
Fehlt hier nicht noch SpectateSystem sync?
Nope, alle Broadcasts werden so aufgenommen.