From 8d8ba668c9eeaa390fa2012bbede3fdd6c02192c Mon Sep 17 00:00:00 2001 From: jojo Date: Mon, 16 Nov 2020 19:41:37 +0100 Subject: [PATCH] Add WorldEdit Shortcuts --- .../commands/worldedit/WECommandFlopyp.java | 6 +++- .../commands/worldedit/WECommandPaste.java | 6 +++- .../commands/worldedit/WECommandReplace.java | 35 ------------------- .../commands/worldedit/WECommandSet.java | 35 ------------------- 4 files changed, 10 insertions(+), 72 deletions(-) delete mode 100644 BauSystem_Main/src/de/steamwar/bausystem/commands/worldedit/WECommandReplace.java delete mode 100644 BauSystem_Main/src/de/steamwar/bausystem/commands/worldedit/WECommandSet.java diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/worldedit/WECommandFlopyp.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/worldedit/WECommandFlopyp.java index 4b9d3c2..fa614ed 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/worldedit/WECommandFlopyp.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/worldedit/WECommandFlopyp.java @@ -29,7 +29,11 @@ import java.util.List; public class WECommandFlopyp extends WECommand { public List onTabComplete(CommandSender sender, Command command, String s, String[] args) { - return manageList(Arrays.asList("-a", "-b", "-e", "-n", "-o", "-s", "-m"), args, args.length - 1); + List tabCompletes = Arrays.asList("-a", "-b", "-e", "-n", "-o", "-s", "-m"); + if (args.length == 0) { + return tabCompletes; + } + return manageList(tabCompletes, args, args.length - 1); } @Override diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/worldedit/WECommandPaste.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/worldedit/WECommandPaste.java index ee3b940..90f0e0a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/worldedit/WECommandPaste.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/worldedit/WECommandPaste.java @@ -29,7 +29,11 @@ import java.util.List; public class WECommandPaste extends WECommand { public List onTabComplete(CommandSender sender, Command command, String s, String[] args) { - return manageList(Arrays.asList("-a", "-b", "-e", "-n", "-o", "-s", "-m"), args, args.length - 1); + List tabCompletes = Arrays.asList("-a", "-b", "-e", "-n", "-o", "-s", "-m"); + if (args.length == 0) { + return tabCompletes; + } + return manageList(tabCompletes, args, args.length - 1); } @Override diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/worldedit/WECommandReplace.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/worldedit/WECommandReplace.java deleted file mode 100644 index 814a4c0..0000000 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/worldedit/WECommandReplace.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - 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.worldedit; - -import org.bukkit.command.Command; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -public class WECommandReplace extends WECommand { - - @Override - public boolean onCommand(CommandSender sender, Command command, String s, String[] args) { - if (!(sender instanceof Player)) return false; - performCommands((Player) sender, "/rep " + String.join(" ", args)); - return false; - } - -} diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/worldedit/WECommandSet.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/worldedit/WECommandSet.java deleted file mode 100644 index 190918a..0000000 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/worldedit/WECommandSet.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - 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.worldedit; - -import org.bukkit.command.Command; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -public class WECommandSet extends WECommand { - - @Override - public boolean onCommand(CommandSender sender, Command command, String s, String[] args) { - if (!(sender instanceof Player)) return false; - performCommands((Player) sender, "/set " + String.join(" ", args)); - return false; - } - -}