From 0ee83c6dd4e6466055d5b09a7adf6ccb804c58f3 Mon Sep 17 00:00:00 2001 From: Zeanon Date: Thu, 1 Apr 2021 19:31:28 +0200 Subject: [PATCH] update for CommandDebugStick --- .../bausystem/commands/CommandDebugStick.java | 53 ++++++------------- BauSystem_Main/src/plugin.yml | 1 - 2 files changed, 15 insertions(+), 39 deletions(-) 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 86bf85e..b005649 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: testblock: aliases: tb