From 8ba6c95da966722360c12a10a0f429e3dad898d5 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 21 Apr 2020 12:24:42 +0200 Subject: [PATCH] Adding a command to the rules Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/BungeeCore.java | 1 + .../bungeecore/commands/RegelnCommand.java | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 src/de/steamwar/bungeecore/commands/RegelnCommand.java diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index f1a3769..50283bb 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -91,6 +91,7 @@ public class BungeeCore extends Plugin { new MuteCommand(); new BugCommand(); new WhoisCommand(); + new RegelnCommand(); new EventStarter(); new Broadcaster(); diff --git a/src/de/steamwar/bungeecore/commands/RegelnCommand.java b/src/de/steamwar/bungeecore/commands/RegelnCommand.java new file mode 100644 index 0000000..53da181 --- /dev/null +++ b/src/de/steamwar/bungeecore/commands/RegelnCommand.java @@ -0,0 +1,25 @@ +package de.steamwar.bungeecore.commands; + +import de.steamwar.bungeecore.BungeeCore; +import net.md_5.bungee.api.CommandSender; +import net.md_5.bungee.api.chat.ClickEvent; +import net.md_5.bungee.api.connection.ProxiedPlayer; + +public class RegelnCommand extends BasicCommand { + public RegelnCommand() { + super("regeln", null); + } + + @Override + public void execute(CommandSender sender, String[] args) { + if(!(sender instanceof ProxiedPlayer)) + return; + ProxiedPlayer player = (ProxiedPlayer) sender; + + BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§7§lRegelwerke"); + BungeeCore.send(player, "§eAirShip§8-§7Regelwerk", "§7https://steamwar.de/spielmodi/airship-regelwerk/", new ClickEvent(ClickEvent.Action.OPEN_URL, "https://steamwar.de/spielmodi/airship-regelwerk/")); + BungeeCore.send(player, "§eMiniWarGear§8-§7Regelwerk", "§7https://steamwar.de/spielmodi/miniwargear-regelwerk/", new ClickEvent(ClickEvent.Action.OPEN_URL, "https://steamwar.de/spielmodi/miniwargear-regelwerk/")); + BungeeCore.send(player, "§eWarGear§8-§7Regelwerk", "§7https://steamwar.de/spielmodi/wargear-regelwerk/", new ClickEvent(ClickEvent.Action.OPEN_URL, "https://steamwar.de/spielmodi/wargear-regelwerk/")); + BungeeCore.send(player, "§eWarShip§8-§7Regelwerk", "§7https://steamwar.de/spielmodi/warship-regelwerk/", new ClickEvent(ClickEvent.Action.OPEN_URL, "https://steamwar.de/spielmodi/warship-regelwerk/")); + } +} -- 2.39.5