From c3f3a5b12ce5b004fd8795e5614516be7bd56372 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 1 Apr 2021 20:57:54 +0200 Subject: [PATCH] Update CommandGills to new SWCommand system --- .../src/de/steamwar/bausystem/BauSystem.java | 2 +- .../bausystem/commands/CommandGills.java | 20 +++++++++---------- BauSystem_Main/src/plugin.yml | 2 -- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java index 75eeaca..d96921e 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java @@ -91,7 +91,7 @@ public class BauSystem extends JavaPlugin implements Listener { new CommandLoader(); getCommand("lockschem").setExecutor(new CommandLockschem()); new CommandDebugStick(); - getCommand("watervision").setExecutor(new CommandGills()); + new CommandGills(); new CommandDetonator(); new CommandScript(); getCommand("scriptvars").setExecutor(new CommandScriptVars()); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandGills.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandGills.java index 8095e91..1060008 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandGills.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandGills.java @@ -20,22 +20,20 @@ package de.steamwar.bausystem.commands; import de.steamwar.bausystem.BauSystem; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; +import de.steamwar.command.SWCommand; import org.bukkit.entity.Player; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; -public class CommandGills implements CommandExecutor { +public class CommandGills extends SWCommand { - @Override - public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (!(sender instanceof Player)) - return false; - Player player = (Player) sender; - toggleGills(player); - return false; + public CommandGills() { + super("watervision", "wv"); + } + + @Register + public void genericCommand(Player p) { + toggleGills(p); } public static void toggleGills(Player player) { diff --git a/BauSystem_Main/src/plugin.yml b/BauSystem_Main/src/plugin.yml index 79a1369..caa4718 100644 --- a/BauSystem_Main/src/plugin.yml +++ b/BauSystem_Main/src/plugin.yml @@ -12,7 +12,5 @@ commands: fire: freeze: aliases: stoplag - watervision: - aliases: wv lockschem: scriptvars: \ No newline at end of file