}
// *****************************************************************
// TeamChat
if (commandName.equals("t")) {
SpoutPlayer player = (SpoutPlayer) sender;
StringBuilder message = new StringBuilder();
for (int i = 0; i < args.length; i++) {
message.append(args[i] + " ");
}
if (ConflictPlugin.playerIsInTeam(player).equals("red")) {
for (SpoutPlayer p : ConflictPlugin.playersRed) {
p.sendMessage("[" + sender.getName() + "]: " + message.toString());
}
} else {
for (SpoutPlayer p : ConflictPlugin.playersBlue) {
p.sendMessage("[" + sender.getName() + "]: " + message.toString());
}
}
}
// BaseBlockRed
if (commandName.equals("bbr")) {
if (ConflictPlugin.allowBBR) {
Player player = (Player) sender;
if (ConflictPlugin.playersRed.contains((SpoutPlayer) player)) {
player.getInventory().addItem(new SpoutItemStack(ConflictPlugin.baseBlockRed, 1));
ConflictPlugin.allowBBR = false; // nur 1x
Bukkit.getServer()
.broadcastMessage("Spieler &c" + player.getName() + " &fhat den roten BaseBlock!");
} else {
sender.sendMessage(ChatColor.RED
+ "Du musst im roten Team sein um diesen Befehl ausf�hren zu k�nnen!");
}
} else {
sender.sendMessage(ChatColor.RED + "Roter BaseBlock wurde bereits verteilt!");
}
return true;
}
// BaseBlockBlue
if (commandName.equals("bbb")) {
if (ConflictPlugin.allowBBB) {
Player player = (Player) sender;
if (ConflictPlugin.playersBlue.contains((SpoutPlayer) player)) {
player.getInventory().addItem(new SpoutItemStack(ConflictPlugin.baseBlockBlue, 1));
ConflictPlugin.allowBBB = false; // nur 1x
Bukkit.getServer().broadcastMessage(
"Spieler &1" + player.getName() + " &fhat den blauen BaseBlock!");
} else {
sender.sendMessage(ChatColor.RED
+ "Du musst im blauen Team sein um diesen Befehl ausf�hren zu k�nnen!");
}
} else {
sender.sendMessage(ChatColor.RED + "Blauer BaseBlock wurde bereits verteilt!");
}
return true;
}
// Artefakt Stufe 1
if (commandName.equals("art")) {
try {
Player player = (Player) sender;
int a = Integer.parseInt(args[0]);
int b = Integer.parseInt(args[1]);
int amount = Integer.parseInt(args[2]);
switch (a) {
case 1:
player.getInventory().addItem(new SpoutItemStack(ConflictPlugin.artifact1Grow.get(b), amount));
Bukkit.getServer().broadcastMessage(
"Spieler &c" + player.getName() + " &fhat sich einen ArtefaktBlock ercheatet!");
break;
case 2:
player.getInventory().addItem(new SpoutItemStack(ConflictPlugin.artifact2Grow.get(b), amount));
Bukkit.getServer().broadcastMessage(
"Spieler &c" + player.getName() + " &fhat sich einen ArtefaktBlock ercheatet!");
break;
case 3:
player.getInventory().addItem(new SpoutItemStack(ConflictPlugin.artifact3Grow.get(b), amount));
Bukkit.getServer().broadcastMessage(
"Spieler &c" + player.getName() + " &fhat sich einen ArtefaktBlock ercheatet!");
break;
}
} catch (Exception e) {
sender.sendMessage(ChatColor.RED + "Invalid arguments");
}
}
// basedef Bl�cke generieren
if (commandName.equals("basedef")) {
try {
Player player = (Player) sender;
int a = Integer.parseInt(args[0]);
int amount = Integer.parseInt(args[1]);
switch (a) {
case 1:
player.getInventory().addItem(new SpoutItemStack(ConflictPlugin.defenseTower, amount));
Bukkit.getServer().broadcastMessage(
"Spieler &c" + player.getName() + " &fhat sich einen DefenseTower ercheatet!");
break;
case 2:
player.getInventory().addItem(new SpoutItemStack(ConflictPlugin.damageTower, amount));
Bukkit.getServer().broadcastMessage(
"Spieler &c" + player.getName() + " &fhat sich einen DamageTower ercheatet!");
break;
case 3:
player.getInventory().addItem(new SpoutItemStack(ConflictPlugin.radarTower, amount));
Bukkit.getServer().broadcastMessage(
"Spieler &c" + player.getName() + " &fhat sich einen RadarTower ercheatet!");
break;
}
} catch (Exception e) {
sender.sendMessage(ChatColor.RED + "Invalid arguments");
}
}
// generiere VuduBrick
if (commandName.equals("vb")) {
try {
Player player = (Player) sender;
int amount = Integer.parseInt(args[0]);
player.getInventory().addItem(new SpoutItemStack(ConflictPlugin.vuduBrick, amount));
} catch (Exception e) {
sender.sendMessage(ChatColor.RED + "Invalid arguments");
}
}
// show red arrows
if (commandName.equals("showred")) {
SpoutPlayer player = (SpoutPlayer) sender;
if (args.length > 0) {
if (args[0].equals("0")) {
ConflictPlugin.showArrowRed.put(player, false);
}
if (args[0].equals("1")) {
ConflictPlugin.showArrowRed.put(player, true);
}
} else {
sender.sendMessage("/" + commandName + " needs one argument (0/1)");
}
return true;
}
// show blue arrows
if (commandName.equals("showblue")) {
SpoutPlayer player = (SpoutPlayer) sender;
if (args.length > 0) {
if (args[0].equals("0")) {
ConflictPlugin.showArrowBlue.put(player, false);
}