feat: add dummy start subcommand
This commit is contained in:
parent
e1e6c4cf45
commit
51e8b2e85e
1 changed files with 24 additions and 0 deletions
|
@ -7,9 +7,16 @@ import java.net.HttpURLConnection;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import com.destroystokyo.paper.Title;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.inventory.InventoryCloseEvent.Reason;
|
||||||
|
import org.bukkit.potion.PotionEffect;
|
||||||
|
import org.bukkit.potion.PotionEffectType;
|
||||||
import org.json.simple.JSONObject;
|
import org.json.simple.JSONObject;
|
||||||
import org.json.simple.JSONValue;
|
import org.json.simple.JSONValue;
|
||||||
import org.json.simple.parser.ParseException;
|
import org.json.simple.parser.ParseException;
|
||||||
|
@ -26,6 +33,10 @@ public class VaroCommand implements CommandExecutor {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
|
if (!sender.hasPermission("varo.admin")) {
|
||||||
|
sender.sendMessage("§c§lFehler: §r§cNicht genügend Rechte für dieses Kommando.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (args.length == 2 && args[0].equals("unban")) {
|
if (args.length == 2 && args[0].equals("unban")) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
final ArrayList<String> bans = (ArrayList<String>) this.plugin.config.get("Varo.Bans");
|
final ArrayList<String> bans = (ArrayList<String>) this.plugin.config.get("Varo.Bans");
|
||||||
|
@ -59,8 +70,21 @@ public class VaroCommand implements CommandExecutor {
|
||||||
"§c§lFehler:§r§c beim Verbinden mit der Mojang-API ist ein Fehler aufgetreten. Eventuell sind die Mojang Server down.");
|
"§c§lFehler:§r§c beim Verbinden mit der Mojang-API ist ein Fehler aufgetreten. Eventuell sind die Mojang Server down.");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else if (args.length == 1 && args[0].equals("start")) {
|
||||||
|
sender.sendMessage("§aStarting...");
|
||||||
|
for (Player p : Bukkit.getServer().getOnlinePlayers()) {
|
||||||
|
// p.getInventory().clear(); //TODO: uncomment after debuging
|
||||||
|
p.closeInventory(Reason.CANT_USE);
|
||||||
|
for (PotionEffect potion : p.getActivePotionEffects())
|
||||||
|
p.removePotionEffect(potion.getType());
|
||||||
|
|
||||||
|
p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 60 * 20, 1, false, false, false));
|
||||||
|
p.sendTitle(new Title("TODO: Title, etc"));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage("\n§6========== §b§lCliffbreak.de VARO §r§6============\n ");
|
sender.sendMessage("\n§6========== §b§lCliffbreak.de VARO §r§6============\n ");
|
||||||
|
sender.sendMessage("§a/varo start: §rStarte das Varo Projekt!");
|
||||||
sender.sendMessage("§a/varo unban [Spieler]: §rSpieler wieder auf den Server lassen");
|
sender.sendMessage("§a/varo unban [Spieler]: §rSpieler wieder auf den Server lassen");
|
||||||
sender.sendMessage("\n§6==========================================");
|
sender.sendMessage("\n§6==========================================");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue