From 7af3544c6162ec3e29094434b9e8d8e2cba8e4bb Mon Sep 17 00:00:00 2001 From: alisolarflare Date: Fri, 16 Dec 2016 13:39:26 -0500 Subject: [PATCH] Broke AliLink --- .../commands/subcommands/ModSubCommand.java | 15 ---------- .../subcommands/PlayerSubCommand.java | 16 ---------- .../commands/subcommands/SubCommand.java | 20 ------------- .../components/alilinks/commands/AliLink.java | 30 ++++++++++++++++--- .../components/alilinks/commands/Press.java | 24 ++------------- 5 files changed, 29 insertions(+), 76 deletions(-) delete mode 100644 src/buttondevteam/alipresents/architecture/commands/subcommands/ModSubCommand.java delete mode 100644 src/buttondevteam/alipresents/architecture/commands/subcommands/PlayerSubCommand.java delete mode 100644 src/buttondevteam/alipresents/architecture/commands/subcommands/SubCommand.java diff --git a/src/buttondevteam/alipresents/architecture/commands/subcommands/ModSubCommand.java b/src/buttondevteam/alipresents/architecture/commands/subcommands/ModSubCommand.java deleted file mode 100644 index 24ba0ee..0000000 --- a/src/buttondevteam/alipresents/architecture/commands/subcommands/ModSubCommand.java +++ /dev/null @@ -1,15 +0,0 @@ -package buttondevteam.alipresents.architecture.commands.subcommands; - -public abstract class ModSubCommand extends SubCommand{ - @Override - public boolean getPlayerOnly() { - // TODO Auto-generated method stub - return true; - } - - @Override - public boolean getModOnly() { - // TODO Auto-generated method stub - return true; - } -} diff --git a/src/buttondevteam/alipresents/architecture/commands/subcommands/PlayerSubCommand.java b/src/buttondevteam/alipresents/architecture/commands/subcommands/PlayerSubCommand.java deleted file mode 100644 index aa7a631..0000000 --- a/src/buttondevteam/alipresents/architecture/commands/subcommands/PlayerSubCommand.java +++ /dev/null @@ -1,16 +0,0 @@ -package buttondevteam.alipresents.architecture.commands.subcommands; - -public abstract class PlayerSubCommand extends SubCommand{ - @Override - public boolean getModOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean getPlayerOnly() { - // TODO Auto-generated method stub - return true; - } - -} diff --git a/src/buttondevteam/alipresents/architecture/commands/subcommands/SubCommand.java b/src/buttondevteam/alipresents/architecture/commands/subcommands/SubCommand.java deleted file mode 100644 index 9501bef..0000000 --- a/src/buttondevteam/alipresents/architecture/commands/subcommands/SubCommand.java +++ /dev/null @@ -1,20 +0,0 @@ -package buttondevteam.alipresents.architecture.commands.subcommands; - -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -public abstract class SubCommand { - public boolean run(CommandSender sender, String label, String[] args){ - if (getPlayerOnly() && (sender instanceof Player)) - return false; - - if (getModOnly() && (sender.hasPermission("Moderator"))) - return false; - - return onCommand((Player) sender, label, args); - } - protected abstract boolean onCommand(Player player, String label, String[] args); - public abstract boolean getPlayerOnly(); - public abstract boolean getModOnly(); - public abstract String[] GetHelpText(String alias); -} diff --git a/src/buttondevteam/alipresents/components/alilinks/commands/AliLink.java b/src/buttondevteam/alipresents/components/alilinks/commands/AliLink.java index e5f9286..1886985 100644 --- a/src/buttondevteam/alipresents/components/alilinks/commands/AliLink.java +++ b/src/buttondevteam/alipresents/components/alilinks/commands/AliLink.java @@ -1,19 +1,21 @@ package buttondevteam.alipresents.components.alilinks.commands; +import org.bukkit.command.Command; +import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; -import buttondevteam.alipresents.architecture.commands.PlayerCommand; +import buttondevteam.alipresents.architecture.commands.BaseCommand; import buttondevteam.alipresents.components.alilinks.AliLinkAPI; -public class AliLink extends PlayerCommand{ +public class AliLink extends BaseCommand{ private JavaPlugin plugin; public AliLink(JavaPlugin plugin) { this.plugin = plugin; } @Override - public boolean OnCommand(Player player, String alias, String[] inputFrequencies) { + public boolean OnCommand(CommandSender player, String alias, String[] inputFrequencies) { if(inputFrequencies.length < 1) return false; @@ -21,12 +23,32 @@ public class AliLink extends PlayerCommand{ case "press": return AliLinkAPI.sendPressEvent(player, inputFrequencies, plugin); case "set": - return AliLinkAPI.createAliLink(player, inputFrequencies); + return AliLinkAPI.createAliLink((Player) player, inputFrequencies); default: return false; } } + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + // TODO Auto-generated method stub + return false; + } + @Override + public String[] GetHelpText(String alias) { + // TODO Auto-generated method stub + return null; + } + @Override + public boolean GetPlayerOnly() { + // TODO Auto-generated method stub + return false; + } + @Override + public boolean GetModOnly() { + // TODO Auto-generated method stub + return false; + } diff --git a/src/buttondevteam/alipresents/components/alilinks/commands/Press.java b/src/buttondevteam/alipresents/components/alilinks/commands/Press.java index a1ad580..4b01942 100644 --- a/src/buttondevteam/alipresents/components/alilinks/commands/Press.java +++ b/src/buttondevteam/alipresents/components/alilinks/commands/Press.java @@ -2,31 +2,13 @@ package buttondevteam.alipresents.components.alilinks.commands; import org.bukkit.entity.Player; -import buttondevteam.alipresents.architecture.commands.subcommands.SubCommand; +import buttondevteam.alipresents.architecture.commands.PlayerCommand; -public class Press extends SubCommand{ +public class Press extends PlayerCommand{ @Override - protected boolean onCommand(Player player, String label, String[] args) { + public boolean OnCommand(Player player, String alias, String[] args) { // TODO Auto-generated method stub return false; } - - @Override - public boolean getPlayerOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean getModOnly() { - // TODO Auto-generated method stub - return false; - } - - @Override - public String[] GetHelpText(String alias) { - // TODO Auto-generated method stub - return null; - } }