diff --git a/src/buttondevteam/alipresents/architecture/commands/BaseCommand.java b/src/buttondevteam/alipresents/architecture/commands/BaseCommand.java
index 6233d3a..16d6127 100644
--- a/src/buttondevteam/alipresents/architecture/commands/BaseCommand.java
+++ b/src/buttondevteam/alipresents/architecture/commands/BaseCommand.java
@@ -1,8 +1,22 @@
package buttondevteam.alipresents.architecture.commands;
+import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
+import org.bukkit.command.CommandSender;
import buttondevteam.lib.chat.TBMCCommandBase;
public abstract class BaseCommand extends TBMCCommandBase implements CommandExecutor{
+ @Override
+ public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
+ // TODO Auto-generated method stub
+ return OnCommand(sender, label, args);
+ }
+ @Override
+ public String[] GetHelpText(String alias){
+ return new String[] {
+ "This command doesn't have help text ask a dev to write one",
+ "If you're a dev, write the help text you lazy bastard. -Ali"
+ };
+ }
}
diff --git a/src/buttondevteam/alipresents/architecture/commands/CommandBlockCommand.java b/src/buttondevteam/alipresents/architecture/commands/CommandBlockCommand.java
new file mode 100644
index 0000000..57775e4
--- /dev/null
+++ b/src/buttondevteam/alipresents/architecture/commands/CommandBlockCommand.java
@@ -0,0 +1,21 @@
+package buttondevteam.alipresents.architecture.commands;
+
+public abstract class CommandBlockCommand extends BaseCommand{
+ @Override
+ public String[] GetHelpText(String alias){
+ return new String[] {
+ "This command doesn't have help text. ",
+ };
+ }
+
+ public boolean GetPlayerOnly() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean GetModOnly() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+}
diff --git a/src/buttondevteam/alipresents/components/alilinks/AliLinkAPI.java b/src/buttondevteam/alipresents/components/alilinks/AliLinkAPI.java
index 8115268..919ec34 100644
--- a/src/buttondevteam/alipresents/components/alilinks/AliLinkAPI.java
+++ b/src/buttondevteam/alipresents/components/alilinks/AliLinkAPI.java
@@ -15,7 +15,7 @@ import org.bukkit.plugin.java.JavaPlugin;
import buttondevteam.alipresents.components.alilinks.entities.Link;
public class AliLinkAPI {
- private static List linkList;
+ public static List linkList = new ArrayList();
/**"Usage: /pressalilink "*/
public static boolean sendPressEvent(CommandSender sender, String[] inputFrequencies, JavaPlugin plugin) {
if (inputFrequencies.length == 0) {
diff --git a/src/buttondevteam/alipresents/components/alilinks/AliLinkComponent.java b/src/buttondevteam/alipresents/components/alilinks/AliLinkComponent.java
index c36f5cc..d1d59b6 100644
--- a/src/buttondevteam/alipresents/components/alilinks/AliLinkComponent.java
+++ b/src/buttondevteam/alipresents/components/alilinks/AliLinkComponent.java
@@ -3,6 +3,7 @@ package buttondevteam.alipresents.components.alilinks;
import org.bukkit.plugin.java.JavaPlugin;
import buttondevteam.alipresents.architecture.Component;
+import buttondevteam.alipresents.components.alilinks.commands.ListLinks;
import buttondevteam.alipresents.components.alilinks.commands.Press;
import buttondevteam.alipresents.components.alilinks.commands.Set;
@@ -18,5 +19,6 @@ public class AliLinkComponent extends Component {
p = plugin;
registerCommand(plugin, new Press());
registerCommand(plugin, new Set());
+ registerCommand(plugin, new ListLinks());
}
}
diff --git a/src/buttondevteam/alipresents/components/alilinks/commands/ListLinks.java b/src/buttondevteam/alipresents/components/alilinks/commands/ListLinks.java
new file mode 100644
index 0000000..1806166
--- /dev/null
+++ b/src/buttondevteam/alipresents/components/alilinks/commands/ListLinks.java
@@ -0,0 +1,22 @@
+package buttondevteam.alipresents.components.alilinks.commands;
+
+import org.bukkit.entity.Player;
+
+import buttondevteam.alipresents.architecture.commands.PlayerCommand;
+import buttondevteam.alipresents.components.alilinks.AliLinkAPI;
+import buttondevteam.alipresents.components.alilinks.entities.Link;
+
+public class ListLinks extends PlayerCommand {
+ @Override
+ public boolean OnCommand(Player player, String alias, String[] args) {
+ for (Link link : AliLinkAPI.linkList){
+ player.sendMessage(link.toString());
+ }
+ return false;
+ }
+ @Override
+ public String GetCommandPath() {
+ return "alilink listlinks";
+ }
+
+}
diff --git a/src/buttondevteam/alipresents/components/alilinks/commands/Press.java b/src/buttondevteam/alipresents/components/alilinks/commands/Press.java
index ac8d642..44dc38e 100644
--- a/src/buttondevteam/alipresents/components/alilinks/commands/Press.java
+++ b/src/buttondevteam/alipresents/components/alilinks/commands/Press.java
@@ -1,23 +1,17 @@
package buttondevteam.alipresents.components.alilinks.commands;
-import org.bukkit.entity.Player;
+import org.bukkit.command.CommandSender;
-import buttondevteam.alipresents.architecture.commands.PlayerCommand;
+import buttondevteam.alipresents.architecture.commands.CommandBlockCommand;
import buttondevteam.alipresents.components.alilinks.AliLinkAPI;
import buttondevteam.alipresents.components.alilinks.AliLinkComponent;
-public class Press extends PlayerCommand {
+public class Press extends CommandBlockCommand {
@Override
public String GetCommandPath() {
return "alilink press";
}
- @Override
- public boolean OnCommand(Player player, String alias, String[] args) {
- if (args.length < 1)
- return false;
- return AliLinkAPI.sendPressEvent(player, args, AliLinkComponent.getPlugin());
- }
@Override
public String[] GetHelpText(String alias){
return new String[] {
@@ -25,4 +19,13 @@ public class Press extends PlayerCommand {
"to your frequency of choice"
};
}
+
+ @Override
+ public boolean OnCommand(CommandSender sender, String alias, String[] args) {
+ if (args.length < 1)
+ return false;
+ return AliLinkAPI.sendPressEvent(sender, args, AliLinkComponent.getPlugin());
+ }
+
+
}