From ca12752b787ec96a3c340a10953a48f1a79e83a1 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 15 Aug 2016 17:05:56 +1000 Subject: [PATCH] Fix FAVS command registration --- favs/src/main/java/com/boydti/fawe/bukkit/favs/Favs.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/favs/src/main/java/com/boydti/fawe/bukkit/favs/Favs.java b/favs/src/main/java/com/boydti/fawe/bukkit/favs/Favs.java index 40752a5c..51f8e71e 100644 --- a/favs/src/main/java/com/boydti/fawe/bukkit/favs/Favs.java +++ b/favs/src/main/java/com/boydti/fawe/bukkit/favs/Favs.java @@ -1,6 +1,7 @@ package com.boydti.fawe.bukkit.favs; import com.boydti.fawe.Fawe; +import com.boydti.fawe.bukkit.BukkitCommand; import com.boydti.fawe.object.FaweCommand; import com.boydti.fawe.object.FawePlayer; import com.thevoxelbox.voxelsniper.SnipeData; @@ -18,7 +19,7 @@ public class Favs extends JavaPlugin { SnipeData.inject(); Sniper.inject(); // Forward the commands so //p and //d will work - Fawe.imp().setupCommand("/p", new FaweCommand("voxelsniper.sniper") { + setupCommand("/p", new FaweCommand("voxelsniper.sniper") { @Override public boolean execute(FawePlayer fp, String... args) { Player player = (Player) fp.parent; @@ -31,7 +32,7 @@ public class Favs extends JavaPlugin { } }); - Fawe.imp().setupCommand("/d", new FaweCommand("voxelsniper.sniper") { + setupCommand("/d", new FaweCommand("voxelsniper.sniper") { @Override public boolean execute(FawePlayer fp, String... args) { Player player = (Player) fp.parent; @@ -49,4 +50,8 @@ public class Favs extends JavaPlugin { ignore.printStackTrace(); } } + + public void setupCommand(final String label, final FaweCommand cmd) { + this.getCommand(label).setExecutor(new BukkitCommand(cmd)); + } }