Commands API- Made some test commands

This commit is contained in:
Florian CUNY 2017-12-10 17:35:39 +01:00
parent 65999aa550
commit 2079c82795
5 changed files with 80 additions and 3 deletions

View File

@ -1,5 +1,6 @@
package us.tastybento.bskyblock.commands;
import org.bukkit.command.CommandSender;
import us.tastybento.bskyblock.api.commands.CompositeCommand;
import us.tastybento.bskyblock.config.Settings;
@ -13,4 +14,9 @@ public class AdminCommand extends CompositeCommand {
public void setup() {
}
@Override
public boolean execute(CommandSender sender, String[] args) {
return false;
}
}

View File

@ -1,6 +1,9 @@
package us.tastybento.bskyblock.commands;
import org.bukkit.command.CommandSender;
import us.tastybento.bskyblock.api.commands.CompositeCommand;
import us.tastybento.bskyblock.commands.island.IslandAboutCommand;
import us.tastybento.bskyblock.commands.island.IslandTeamCommand;
import us.tastybento.bskyblock.config.Settings;
public class IslandCommand extends CompositeCommand {
@ -11,6 +14,13 @@ public class IslandCommand extends CompositeCommand {
@Override
public void setup() {
this.addSubCommand(new IslandAboutCommand());
this.addSubCommand(new IslandTeamCommand());
}
@Override
public boolean execute(CommandSender sender, String[] args) {
sender.sendMessage("You successfully did /is !");
return true;
}
}

View File

@ -1,4 +1,24 @@
package us.tastybento.bskyblock.commands.island;
public class IslandAboutCommand {
import org.bukkit.command.CommandSender;
import us.tastybento.bskyblock.api.commands.CommandArgument;
import java.util.Set;
public class IslandAboutCommand extends CommandArgument {
public IslandAboutCommand() {
super("about", "ab");
}
@Override
public boolean execute(CommandSender sender, String[] args) {
sender.sendMessage("You did /is about successfully!");
return false;
}
@Override
public Set<String> tabComplete(CommandSender sender, String[] args) {
return null;
}
}

View File

@ -1,4 +1,25 @@
package us.tastybento.bskyblock.commands.island;
public class IslandTeamCommand {
import org.bukkit.command.CommandSender;
import us.tastybento.bskyblock.api.commands.CommandArgument;
import java.util.Set;
public class IslandTeamCommand extends CommandArgument {
public IslandTeamCommand() {
super("team");
this.addSubCommand(new IslandTeamInviteCommand());
}
@Override
public boolean execute(CommandSender sender, String[] args) {
sender.sendMessage("Hey, you've got a pretty team there :D");
return false;
}
@Override
public Set<String> tabComplete(CommandSender sender, String[] args) {
return null;
}
}

View File

@ -1,4 +1,24 @@
package us.tastybento.bskyblock.commands.island;
public class IslandTeamInviteCommand {
import org.bukkit.command.CommandSender;
import us.tastybento.bskyblock.api.commands.CommandArgument;
import java.util.Set;
public class IslandTeamInviteCommand extends CommandArgument {
public IslandTeamInviteCommand() {
super("invite");
}
@Override
public boolean execute(CommandSender sender, String[] args) {
sender.sendMessage("Wants to invite some people, hu?");
return false;
}
@Override
public Set<String> tabComplete(CommandSender sender, String[] args) {
return null;
}
}