feat: move test command to varo subcommand
This commit is contained in:
parent
51e8b2e85e
commit
7b5c215742
5 changed files with 14 additions and 36 deletions
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
|
@ -7,6 +7,7 @@
|
|||
"Gamerules",
|
||||
"Mojang",
|
||||
"cliffbreak",
|
||||
"teamcolors",
|
||||
"unban",
|
||||
"varo"
|
||||
],
|
||||
|
|
|
@ -12,7 +12,6 @@ import org.bukkit.configuration.file.FileConfiguration;
|
|||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import de.cliffbreak.varo.commands.TestCommand;
|
||||
import de.cliffbreak.varo.commands.VaroCommand;
|
||||
import de.cliffbreak.varo.listeners.BannedItemListener;
|
||||
import de.cliffbreak.varo.listeners.ChatListener;
|
||||
|
@ -46,7 +45,6 @@ public class Varo extends JavaPlugin {
|
|||
getServer().getPluginManager().registerEvents(new BannedItemListener(), this);
|
||||
|
||||
getCommand("varo").setExecutor(new VaroCommand(this));
|
||||
getCommand("test").setExecutor(new TestCommand());
|
||||
|
||||
for (World world : getServer().getWorlds()) {
|
||||
if (world.getEnvironment() == Environment.NORMAL) {
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
package de.cliffbreak.varo.commands;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import de.cliffbreak.varo.uitls.MessageUtils;
|
||||
|
||||
public class TestCommand implements CommandExecutor {
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player))
|
||||
return false;
|
||||
Player p = (Player) sender;
|
||||
p.sendMessage(MessageUtils.getRichTextComponent("§c" + "Team 01", ""));
|
||||
p.sendMessage(MessageUtils.getRichTextComponent("§6" + "Team 02", ""));
|
||||
p.sendMessage(MessageUtils.getRichTextComponent("§e" + "Team 03", ""));
|
||||
p.sendMessage(MessageUtils.getRichTextComponent("§2" + "Team 04", ""));
|
||||
p.sendMessage(MessageUtils.getRichTextComponent("§a" + "Team 05", ""));
|
||||
p.sendMessage(MessageUtils.getRichTextComponent("§b" + "Team 06", ""));
|
||||
p.sendMessage(MessageUtils.getRichTextComponent("§3" + "Team 07", ""));
|
||||
p.sendMessage(MessageUtils.getRichTextComponent("§9" + "Team 08", ""));
|
||||
p.sendMessage(MessageUtils.getRichTextComponent("§d" + "Team 09", ""));
|
||||
p.sendMessage(MessageUtils.getRichTextComponent("§5" + "Team 10", ""));
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -22,6 +22,7 @@ import org.json.simple.JSONValue;
|
|||
import org.json.simple.parser.ParseException;
|
||||
|
||||
import de.cliffbreak.varo.Varo;
|
||||
import de.cliffbreak.varo.uitls.MessageUtils;
|
||||
|
||||
public class VaroCommand implements CommandExecutor {
|
||||
|
||||
|
@ -82,10 +83,22 @@ public class VaroCommand implements CommandExecutor {
|
|||
p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 60 * 20, 1, false, false, false));
|
||||
p.sendTitle(new Title("TODO: Title, etc"));
|
||||
}
|
||||
} else if (args.length == 1 && args[0].equals("teamcolors")) {
|
||||
sender.sendMessage(MessageUtils.getRichTextComponent("§c" + "Team 01", ""));
|
||||
sender.sendMessage(MessageUtils.getRichTextComponent("§6" + "Team 02", ""));
|
||||
sender.sendMessage(MessageUtils.getRichTextComponent("§e" + "Team 03", ""));
|
||||
sender.sendMessage(MessageUtils.getRichTextComponent("§2" + "Team 04", ""));
|
||||
sender.sendMessage(MessageUtils.getRichTextComponent("§a" + "Team 05", ""));
|
||||
sender.sendMessage(MessageUtils.getRichTextComponent("§b" + "Team 06", ""));
|
||||
sender.sendMessage(MessageUtils.getRichTextComponent("§3" + "Team 07", ""));
|
||||
sender.sendMessage(MessageUtils.getRichTextComponent("§9" + "Team 08", ""));
|
||||
sender.sendMessage(MessageUtils.getRichTextComponent("§d" + "Team 09", ""));
|
||||
sender.sendMessage(MessageUtils.getRichTextComponent("§5" + "Team 10", ""));
|
||||
} else {
|
||||
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 teamcolors: §rZeige verfügbare Team-Farben an");
|
||||
sender.sendMessage("\n§6==========================================");
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -4,10 +4,6 @@ description: Custom Cliffbreak.de Varo
|
|||
version: 0.1
|
||||
api-version: 1.15
|
||||
commands:
|
||||
test:
|
||||
description: A command to test certain plugin behaviors.
|
||||
aliases: [t]
|
||||
usage: /<command>
|
||||
varo:
|
||||
description: The Main Varo command.
|
||||
usage: /<command>
|
Loading…
Reference in a new issue