diff --git a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java index 009683f..41560b9 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java @@ -81,6 +81,7 @@ public class BauSystem extends JavaPlugin implements Listener { getCommand("reset").setExecutor(new CommandReset()); new CommandSpeed(); new CommandTNT(); + new CommandBau(); getCommand("fire").setExecutor(new CommandFire()); getCommand("freeze").setExecutor(new CommandFreeze()); new CommandTestblock(); @@ -89,7 +90,7 @@ public class BauSystem extends JavaPlugin implements Listener { getCommand("skull").setExecutor(new CommandSkull()); getCommand("loader").setExecutor(new CommandLoader()); getCommand("lockschem").setExecutor(new CommandLockschem()); - getCommand("debugstick").setExecutor(new CommandDebugStick()); + new CommandDebugStick(); getCommand("watervision").setExecutor(new CommandGills()); getCommand("detonator").setExecutor(new CommandDetonator()); getCommand("detonator").setTabCompleter(new CommandDetonatorTabCompleter()); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandDebugStick.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandDebugStick.java index b3ac2bf..14c711c 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandDebugStick.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandDebugStick.java @@ -1,49 +1,26 @@ -/* - This file is a part of the SteamWar software. - - Copyright (C) 2020 SteamWar.de-Serverteam - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . -*/ - package de.steamwar.bausystem.commands; import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.world.Welt; +import de.steamwar.command.SWCommand; import de.steamwar.core.VersionedRunnable; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -public class CommandDebugStick implements CommandExecutor { +public class CommandDebugStick extends SWCommand { - @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!(sender instanceof Player)) - return false; - Player player = (Player) sender; - - if (Welt.noPermission(player, Permission.build)) { - player.sendMessage(BauSystem.PREFIX + "§cKein Debugstick für dich hier."); - return false; - } - - VersionedRunnable.call(new VersionedRunnable(() -> player.sendMessage(BauSystem.PREFIX + "§cDen Debugstick gibt es nicht in der 1.12."), 8), - new VersionedRunnable(() -> CommandDebugStick_15.giveStick(player), 15)); - return false; + public CommandDebugStick() { + super("debugstick"); } -} + + @Register + public void genericCommand(Player p) { + if (Welt.noPermission(p, Permission.build)) { + p.sendMessage(BauSystem.PREFIX + "§cKein Debugstick für dich hier."); + } else { + VersionedRunnable.call(new VersionedRunnable(() -> p.sendMessage(BauSystem.PREFIX + "§cDen Debugstick gibt es nicht in der 1.12."), 8), + new VersionedRunnable(() -> CommandDebugStick_15.giveStick(p), 15)); + } + } +} \ No newline at end of file diff --git a/BauSystem_Main/src/plugin.yml b/BauSystem_Main/src/plugin.yml index 241c660..506dcd6 100644 --- a/BauSystem_Main/src/plugin.yml +++ b/BauSystem_Main/src/plugin.yml @@ -9,7 +9,6 @@ website: "https://steamwar.de" description: "So unseriös wie wir sind: BauSystem nur besser." commands: - debugstick: fire: reset: protect: